To run, clone this repo to your local machine, navigate to the project directory, and run yarn start
(assuming you have all necessary dependencies installed). Then go to localhost:3000
in your browser.
If you want to cheat, you can open up your browser's console, where I print out the locations of all the mines. This is a vestige from developing/debugging.
-
In Windows Minesweeper, it seems like your first click will always be on a cell without a mine. In other words, they generate the mine layout after the player makes the first left click. My implementation currently generates the mine layout first, before the player makes the first left click, so it is possible to lose on the first turn.
-
In my implementation, the player can only win if they place flags on all the cells with mines, and have no flags on cells without mines. In Windows Minesweeper, the player can win in the following condition: the number of unrevealed cells equals the number of remaining mines, even if the player hasn't placed flags on those cells yet.
-
In Windows Minesweeper, if the player loses, and had incorrectly flagged cells that didn't actually have mines in them, the player will see those cells be revealed with a mine with a red X on top of it, indicating their mistake. In my implementation, I just show a red X. An improvement that I could later do is to have my implementation mirror Windows's.