Kingdom of Zed
Authors: Kayci Wang, Joanna Tu, Nathan Tong
What is the problem?
We implement the Kingdom of Zed game as defined on http://www.cs.sfu.ca/CourseCentral/383/pjj/a1.html
What is the something extra?
We will attempt to implement 2-3 additional tasks specified on http://www.cs.sfu.ca/CourseCentral/383/pjj/a1.html Namely, we implemented the tasks: 1. Allow maps of Zed or arbitrary size, i.e. any n×n map for n >= 2. 2. Allow incomplete information. For this option, merchants may with-hold information from you. If they do, their clue is represented as a 0 (zero). 3. Display the output as a grid (not a list).
What did we learn from doing this?
Using Haskell to implement this game was quite suitable, but it wasn't a simple task. It was relatively reasonable to add constraints to the program in order to abide to the game rules; the different possible cases that arise in the game could be accounted for through different if-then guards in Haskell. Haskell also allowed us to create functions that served to validate and check that all the rules of the game were satisfied before proceeding in confirming that a correct solution was found.
The difficulties we encountered during the implementation of the program were mainly in debugging the validation functions. The Kingdom of Zed game requires several validations to follow its restraints (i.e. making sure the ascending order of the grid holds for all directions corresponding to the merchant numbers). Sometimes one validation would be flawed, and the result we received would be accepted even though it was a faulty solution. We needed to run several tests to ensure the program runs properly for all accepted kinds of input.
Link to Project: https://github.com/kitty7756/CPSC312-KingdomOfZed