Skip to content
This repository was archived by the owner on Mar 26, 2020. It is now read-only.

Josef37/minesweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper

TypeScript minesweeper with solver

This project is a simple minesweeper game with an automatic solver, which computes a probability distribution of mines.

Demo

Thanks to GitHub Pages, here it is https://josef37.github.io/minesweeper/built/

How to run

Open deploy/index.html in your preferred browser

How to setup this project

  1. Good old npm install
  2. Build (with local browserify): npm run build

Settings and controls (before UI)

  • In bundle.js change let gameboard = new gameboard_1.Gameboard(width, height, totalNumberOfMines, isSaveFirstAction=true).
  • Left-click on an unrevealed cell to reveal it.
  • Right-click on an unrevealed cell to flag it (and block revealing).
  • Left-click on a revealed cell, with mine count and number of flags matching, to reveal all adjacent cells.
  • Press P to display the probability distribution of mines.
  • Press S to automatically do the next action the solver suggests.
  • Press T to test 100 rounds of the solver (result in console)

Solving Performance

At commit 9d06109 (prioritizing corner cells)

Wins Rounds Rate
389 1000 38.9%
385 1000 38.5%
376 1000 37.6%
401 1000 40.1%
400 1000 40%
3823 10000 38.2%
3909 10000 39.1%

About

JavaScript minesweeper with solver

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •