CPSC 312 project sam srijon

From UBC Wiki

CPSC 312 Project Sam Srijon

Authors: Sam, Srijon

What is the problem?

We wanted to explore how good and easy it was to implement games in Haskell compared to OOP languages. We built a Haskell implementation of connect-4 with pvp (multiplayer) functionality, as well as a CPU (single player) functionality with varying degrees of difficulty.

What is the something extra?

We created an CPU single player version with three (increasing) levels of difficulty, as well as a pvp version that takes 2 players.

What did we learn from doing this?

(This should be written after you have done the work.) What is the bottom-line? Is functional programming suitable for (part-of) the task? Make sure you include the evidence for your claims.

We learned how to design top down and build bottom up. We learned that Haskell is great for writing games as it is not as verbose as OOP languages like Java. We wrote the game in fewer lines of code than expected. When checking for the win conditions of the game, we had to write multiple recursive functions that simulated a simple iterative pattern. This would have been much easier with a language that provides loops.

Links to code etc