Click on the tiles and try not to get exploded.
- Left click - reveal a tile
- Shift + left click (unflagged tile) - flag a tile
- Shift + left click (flagged tile) - unflag a tile
Press the Options button at the top to view the options bar. The bar allows to:
- Activate Superman Mode™ that shows the location of mines on the board.
- Restart the game with the current or new row, column and mine inputs (supports a board of up to 300x300).
Click on tiles to reveal them. Flag all mines to win, click on a mine to lose and be exploded back to the start.
- Clone the repo
npm i
npm start
This project includes unit tests for the helper methods, some basic integration tests for the rendering of components and end to end tests written in incredible Cypress.
run npm test
.
npm start
(note - the tests expect the app to run on localhost:3000)npm run cypress:open
- click on "Run all specs".
The app should be responsive and work somewhat well on mobile devices as well.
Supporting a 100x100+ board that looks remotely decent in a SPA on the browser proved to be problematic as even the initial rendering
of the board could take ages.
Using React.memo
introduced more problems that performance improvements so I used react-window
to solve it when it comes to bigger boards.
The app seems to perform well with any given size with the use of virtual scrolling, although UX is not ideal.