Skip to content

Instantly share code, notes, and snippets.

@rkasbach
Last active August 29, 2015 14:06
Show Gist options
  • Save rkasbach/6dad2e33d9a175fdd6e6 to your computer and use it in GitHub Desktop.
Save rkasbach/6dad2e33d9a175fdd6e6 to your computer and use it in GitHub Desktop.
Game steps:
* When the game starts, the player gets prompted for the grid size (width x height) and the number of mines.
* The grid is generated according to these requirements.
* The games starts, the user is prompted for the coordinates (x, y) of the first cell to uncover.
* The game shows the resulting grid and prompts for new coordinates.
* And so on ...
The game ends when there is no more non-mined cell to uncover or the player uncovers a mine.
Rules:
* Uncover a mine, and the game ends.
* Uncover an empty cell, and the player keeps playing.
* In each empty uncovered cell the number of adjacent cells holding mines is displayed.
* Uncovering a cell holding the number '0' (=no adjacent mined cells) uncovers all adjacent cells, and so on.
Notes:
Command-line is sufficient, no fancy ui needed.
Basically it's the good old windows minesweeper (minus flags).
@micheleorsi
Copy link

Here is my implementation:
https://github.com/micheleorsi/minesweeper

I tried to use at best the design patterns along the full project. On the other hand I was a bit in a rush at the end and "MainApplication" is the only part a bit 'quick & dirty' ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment