This is an assignment for Wix frontend position. Wish me luck ๐
This is a working example for a static Javascript minesweeper, The task is to implement the classic minesweeper game in javascript. You should use ReactJS (not implemented here). The aim of the exercise is to test the coding standards so please make sure the code is organized and clean,
-
Board should be of configurable width, height and mines number.
-
The board should support width and height of up to 300 (300x300 cells),
-
Should display an indication of the number of remaining flags above the board.
-
Click on cell reveals the value underneath it:
-
If it is a mine, you lose.
-
Otherwise, display the number of mines around the cell (or empty if there are no mines around)
-
If there are no mines around the cell, reveal all cells around it and and all cells around any adjacent empty cell.
-
-
Shift button + Left Mouse Click puts or removes a flag on that cell. (and updates the number of remaining flags)
-
Display alert if player tries to add a flag but he does not have any remaining flags.
-
A flagged cell cannot be revealed (click does nothing) until the flag is removed.
-
If all mines are flagged correctly, you win.
- Add tests (specify in the readme.md file how can we run them)
- Create a Superman mode that reveals the location of the bombs (the working example mentioned below supports it)
You can find an example of a working implementation at https://wix-incubator.github.io/minesweeper/ (the source is found at https://github.com/wix-incubator/minesweeper)
Note that it does not support a large board (even 100x100), not written in React and looks quite ugly (we didnโt want to give you any design ideas).
Questions about the task can submitted as an issue in the repository: https://github.com/wix-incubator/minesweeper/issues
Please upload your code to Github or Plunkr, it should include the sources as well as a runable example (as a Github Page in github.io or Plunkr), and send the link to your contact person at Wix.
Since many people are struggling with Github Pages, you can refer to the following repository for an example with some explanations
Good Luck!