AoiYamada / minesweeper

A library for creating minesweeper game

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation

npm i git+https://github.com/AoiYamada/minesweeper

Usage

<script src="./dist/MineSweeper.js"></script>

Creat a new game

var game = new MineSweeper({
  width: 10,
  height: 10,
  mine: 10,
});

Play it in console

Only 2 methods are available

var open = (x, y) => {
  game.open(x, y);
  console.log("Time:", game.timer);
  console.log("State:", game.state);
  console.log(game.toString())
}
var flag = (x, y) => {
  game.flag(x, y);
  console.log(game.toString())
}

Develop

npm run build

About

A library for creating minesweeper game

License:MIT License


Languages

Language:JavaScript 91.3%Language:HTML 8.7%