This page links to a selection of implementations of minesweeper in Haskell. These were written in 2002, and were used as a (personal) case study for refactoring Haskell programs.
Minesweeper is a long-lived and popular computer game, with a plethora of implementations (just `google' for minesweeper). The game is played on a rectangular board divided into a number of squares; beneath some of the squares lie mines. Clicking on a mine loses the game; if there is no mine present, the square is cleared, and the number of mines on adjacent squares is shown. In fact, if the square is unoccupied then the whole mine-free region containing the square is uncovered. The player wins when all the mines are marked, and all other squares are cleared.
q Quit h Help information m7b Mark position 7b u7b Unmark position 7b r7b Reveal position 7b s7b Show equations at 7b a7b Automatic turn at 7b t7b Transitive automatic from 7bThese commands should not be followed by a newline/carriage return.
playGrid
.
playGame m n
where m is number of mines and n the size
of the square.
Minesweeper2
.
Minesweeper2
.
Minesweeper2
.
Planet Minesweeper, the world's most complete online resource for Minesweeper: tips and advices, world rankings, videos, active forum...