Course:CPSC312-2017-Minesweeper Haskell

From UBC Wiki
Office Hours:
Class Schedule:
Important Course Pages
Lecture Notes
Course Discussion


Authors: Phelan H, Mesbah M

What is the problem?

We'll be using Haskell to create the classic single-player puzzle game: minesweeper. The objective of minesweeper is to clear a board of tiles without hitting any of the bombs. The rules for minesweeper can be found here: Each game will start with a randomly generated 8x8 board. Players will be able to select a tile to clear or flag. A player wins when all bombs have been flagged and all tiles cleared, and loses when a bomb is hit.

What is the something extra?

We'll be adding a user interface that shows the state of the board, all cleared/flagged tiles, and the number of bombs surrounding each cleared tile.

What did we learn from doing this?

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

We found that Haskell is fairly suitable for the task of creating minesweeper. In terms of clearing all squares around a square that has no adjacent bombs, it was pretty easy to do recursively with Haskell. However, we found that printing the board was slightly challenging at first because iterating through a list in Haskell is not the easiest thing to do, especially when you want to pass additional parameters to the function you are executing on each list item.