Skip to content

a-ehlert/prolog-minesweeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

prolog-minesweeper

Prolog Minesweeper with some AI assistance

How to play

To start a preset game mode, type ‘play(mini).’, ‘play(easy).’, ‘play(normal).’ or ‘play(hard).’. Instructions will follow. To start a custom game, type play(H,W,N) where H, W, N are the Height, Width, and Number of mines respectively. For example, play(easy) is equivalent to play(8,8,10).

Notes

I recommend you run this in SICStus Prolog, as SWI-Prolog seems to run out of stack. May be due to default stack size or superior pruning in SICStus.

Examples of AI play

AI finds the only guaranteed safe move

Image 1

Later, the game is cleared.

Image 2

Example of an ambiguous state. In this case, the AI finds (one of) the safest moves and executes it.

Image 3

About

Prolog Minesweeper with some AI assistance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages