Kingdom of Zed

From UBC Wiki

Project Link

Authors: Julian Chan, Mitchell Currie

What is the problem?

We will be recreating the game: Kingdom of Zed.

Source: http://www.cs.sfu.ca/CourseCentral/383/pjj/a1.html

What is the something extra?

From the additional functionalities in the original project specifications, we will be looking to complete the following:

1.Allow maps of Zed of arbitrary size, i.e. any n×n map for n >= 2

2.Display the output as a grid (not a list)

3.Solve clues with missing information

What did we learn from doing this?

From the beginning of the project, we had a good idea of what we wanted to do and the tasks which needed to be accomplished to meet our goal. However, implementing these ideas in Haskell was another story as we found that it was incredibly cumbersome and doing simple tasks as simple as getting the columns of the board more complicated than necessary. This was because the board was represented as a list of list of integers. Thus we needed to recurse through the list to access the elements we wanted. This was equally true for the construction of the grid for our extra deliverable. The grid layout required that the clues wrapped the Zed board. What made it a lengthy process was wrapping the column clues around the Zed board; again this is because clues and the board were represented as rows.

We found that the enormous solution space generated by this problem makes it difficult to find solutions for larger boards, and using Haskell to attempt to solve this problem without generating a massive amount of permutations proved very difficult as a novice to the language. A type of solution tree searching data structure may be useful, but we found that Haskell is not friendly in making these easy to understand.

Links to code etc

Github