minesjs

1.0.2 • Public • Published

MinesweeperJS

A Javascript implementation of the classic minesweeper game with a helper to guide a player on how the game is played and show the patterns that can be used to solve the game.

Example

A demo of the package can be found here

Getting started

First include the css and javascript files from the dist folder on your page.

Then starting a game is easy!

  minesweeperjs.start(element[, options]);

The element can be an HTMLElement or an element's id or class, e.g. ("#element-id", ".element-class")

Options

difficulty - default ("easy")

The difficulty the game is initialized with. Values can be "easy", "medium", or "hard"

minesweeperjs.start("#example-element", {
  difficulty: "hard"
});
  • Easy - 8x8 grid with 10 mines
  • Medium - 16x16 grid with 40 mines
  • Hard - 30x16 grid with 99 mines

showSolver - default (true)

The game can be initalized without displaying the solver help if you simply want to have a minesweeper game without the fuss.

minesweeperjs.start("#example-element", {
  showSolver: false
});

Readme

Keywords

Package Sidebar

Install

npm i minesjs

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

1.97 MB

Total Files

10

Last publish

Collaborators

  • aflannery