Minesweeper Game Logic
A small package including the minesweeper game logic. The minesweeper game is a fantastic exercise to learn a new Frontend framework, such as Vue, React, Svelte or Angular.
Installation
Using yarn:
yarn add minesweeper-logic
or npm:
npm i minesweeper-logic
Usage
Use the makeGameBoard
function to generate a size
by size
game board with size
randomly placed mines:
The game board is a bidimensional array where each element represents a cell:
When a cell needs to be uncovered, use the updateBoard
function.
This function returns a new updated board together with some game stats:
In your code: