Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

joaooliveira-11/feup-pfl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

feup-pfl

Project 1 - Apart Board Game with Prolog

  • Human vs Human;
  • Human vs Computer;
  • Computer vs Computer;
  • Bot lvl 1 (random) and Bot lvl 2 (greedy);
  • AI program using Minimax algorithm with board evaluation to predict oponnent's movements.

Project 2 - Haskell Compiler

  • Low-level machine with configurations of the form (c, e, s) where c is a list of instructions to be executed, e is the evaluation stack, and s is the storage.
  • The instructions of the machine are: push-n, add, mult, sub, true, false, eq, le, and, neg, fetch-x, store-x, noop, branch(c1, c2) and loop(c1, c2.
  • Development of a small imperative programming language with arithmetic and boolean expressions, and statements consisting of assignments of the form x := a, sequence of statements (instr1 ; instr2), if then else statements, and while loops.
  • Development of a compiler from this language into lists of instructions in the previous machine.
  • Development of a parser and lexer which transforms an imperative program represented as a string into its corresponding representation in the Stm data (a list of statements Stm) ready to be compiled.