Minesweeper for curses.
![]() |
11 May 2004 | 8.0k |
![]() |
11 May 2004 | 8.4k |
This is another implementation of minesweeper, but using curses. Boasts mouse support, colour, and a 'solver/hint' algorithm.
See also:
About the solver: Not all games are solvable, but here is a description of the algorithm I used. Scan the grid, from the top left, looking for an exposed cell with number n. Count the number of covered cells still surrounding it, c, and of those cells cound the number that are flagged, f. If f>n there is a problem (too many flags). But, if f=n then we have flagged all the bombs around that cell, so you can immediately expose the remaining c-f adjacent cells. Repeat this, starting at the top left cell again. If you exhaust all cells without exposing anything, then the game is either solved, or unsolvable (without guessing).
The subversion repository for this software can be accessed through http://svn.adaptive-enterprises.com/misc/cmine
or browsed with ViewVC.
This software has been placed in the public domain.