To play, visit https://alexbuz.github.io/mindsweeper/. Once the page loads, no further internet connection is required.
Traditional minesweeper is a game of logical deduction—until it's not. Sometimes, you end up in a situation where there is not enough information to find a tile that is definitely safe to reveal. In such cases, guessing is required to proceed, and that often leads to the loss of an otherwise smooth-sailing game. However, there's no reason it has to be that way. It's merely a consequence of the random manner in which mines are typically arranged at the start of the game. Some mine arrangements happen to necessitate guessing, while others do not. This is a matter of luck, and it's not a particularly fun aspect of a game that is otherwise about logic.
Eliminating the need for guesswork, then, is a matter of modifying the mine arrangement algorithm. Rather than simply placing each mine under a random tile, it should instead consider each mine arrangement as a whole, choosing a random mine arrangement from the set of mine arrangements that would allow a perfect logician to win without guessing. Ideally, it should sample uniformly from that set of mine arrangements, ensuring that every such arrangement is equally likely to be chosen. That is precisely what mindsweeper is designed to do, and it accomplishes this within a matter of milliseconds after you make your first click.
Install Trunk, and then run trunk build
in the project directory:
git clone https://github.com/alexbuz/mindsweeper.git
cd mindsweeper
trunk build
The built files will be placed in the dist
directory, the contents of which must be served to the
user.
For development, instead of trunk build
, you can run trunk serve --public-url=/ --open
to start
a local server that automatically rebuilds the project when you make changes.