8000 GitHub - ccapitalK/minesweeper-solver: Short experiment to write an (unoptimized) solver for minesweeper. Takes ascii art representation of board as input
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Short experiment to write an (unoptimized) solver for minesweeper. Takes ascii art representation of board as input

Notifications You must be signed in to change notification settings

ccapitalK/minesweeper-solver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minesweeper solver

A simple command line solver for minesweeper, that solves by exhaustively searching the consequences of constraints. Mostly done as a quick experiment.

Input format

Ascii art grid, one character = one tile

  • . = Empty cell
  • 0-9 = Expanded tile with this many neighbours known to be mines

Output format

Same grid as input, with some Empty Cells replaced as follows

  • $ = cell that is known to not contain a mine
  • # = cell that is known to contain a mine

How to run

  • Install dlang toolchain (dub, dmd, visit https://dlang.org/ for more info)
  • dub build
  • ./minesweeper-solver PATH_TO_INPUT_FILE

Output when run on example_input.txt

START
Solved after 150 constraints searched
......$#101$.
......$1101#.
......$10012.
....#$#10001.
..$$#3110001.
..1111000001.
..1000000013.
..100000112#.
..1000001#$$.
..2100124$...
..#2102###...
..$#424#.....
...###$#.....
END

About

Short experiment to write an (unoptimized) solver for minesweeper. Takes ascii art representation of board as input

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0