Terminal Checkers (Sofia, Joey)
Course: CPSC 312
What is the problem?[edit | wikitext]
We will implement a checkers game in prolog to compare to our project 1 checkers game done in Haskell. It would be useful to see how the two programs compare in efficiency and difficulty concerning implementation and feasibility of the project.
What is the something extra?[edit | wikitext]
We will implement an AI as an "advanced" level that the user can choose to play. The "easy" level will be a set of random moves generated.
What did we learn from doing this?[edit | wikitext]
- Comparing implementation to Haskell, it seemed easier to reason through the implementation in Haskell rather than prolog. It seemed more intuitive to create a game based on functions rather than logic. Since Haskell depends more on recursion, it was easier to use this functionality to implement a game.
- Further, the I/O functionality in Haskell proved to be useful for user interaction. Prolog did not have this same functionality because everything must be input with the query. However,
- Prolog does have a GUI framework, but because of our limited knowledge in this, we decided not to use this functionality in our implementation.
- Prolog was efficient in the sense that creating representations for the board and the pieces was easier to implement with logic because there are a finite amount of ways (that are intuitive) that this could be implemented.
- Lastly, the capture (eat) implementation in prolog proved be be an easier implementation due to the use of logic that is in place by the rules of the game.
Links to code etc
Our code can be found using the following link: https://github.com/josephdeeth/prolog-checkers/blob/master/main.pl