A Javascript implementation of the classic minesweeper game with a helper to guide a player on how the game is played and show the patterns that can be used to solve the game.
A demo of the package can be found here
First include the css and javascript files from the dist folder on your page.
Then starting a game is easy!
minesweeperjs.start(element[, options]);
The element can be an HTMLElement or an element's id or class, e.g. ("#element-id", ".element-class")
The difficulty the game is initialized with. Values can be "easy", "medium", or "hard"
minesweeperjs.start("#example-element", {
difficulty: "hard"
});
- Easy - 8x8 grid with 10 mines
- Medium - 16x16 grid with 40 mines
- Hard - 30x16 grid with 99 mines
The game can be initalized without displaying the solver help if you simply want to have a minesweeper game without the fuss.
minesweeperjs.start("#example-element", {
showSolver: false
});