This is a replica of the original Minesweeper puzzle game, but instead of mines it is trollfaces.
The code is somewhat generic. You can play around with the variables in the SetupCanvas()
-function:
cols
is the number of columnsrows
is the number of rows.cellSize
is the size of a cell.numTrollCells
is the number of trolls hiding.
If you do not want to test the code there is a live version on my webpage.
- Make the user deside the number of cells and trolls.
Inspired by the coding challenge #71 made by @TheCodingTrain