A web based implementation of the classic game of Minesweeper built using JavaScript, HTML, and CSS.
Minesweeper is a web based implementation of the classic game of Minesweeper. It is built using JavaScript, HTML, and CSS. It allows users to play the game of Minesweeper.
- The goal of the game is to clear a rectangular board containing hidden "mines" or bombs without detonating any of them, with help from clues about the number of neighboring mines in each field. The game originates from the 1960s, and has been written for many computing platforms in use today. It has many variations and offshoots.
- Click on a square to reveal it. If it is a mine, you lose. If it is not a mine, it will reveal a number. This number represents the number of mines that are adjacent to that square. If the number is 0, it will reveal all adjacent squares. If you reveal all squares that are not mines, you win.
- If you are unsure about a square, you can right click on it to place a flag. This will prevent you from accidentally clicking on it. You can also right click on a square with a flag to remove the flag. There is a limit to the number of flags you can place. The maximum number of flags is equal to the number of mines on the board.
- The number of mines on the board is displayed at the top of the page. It is calculated on the fly, so it will change as you place and remove flags.
- Users can choose the size of the board. The number of mines is 20 percent of the total number of squares on the board.
- JavaScript
- HTML
- CSS
- Data Structures(2D Arrays)
- Algorithms(Flood Fill)
- Object Oriented Programming(OOP)
Visit the website here and play the game.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.