Remix.run Logo
robinhouston 5 days ago

Simon Tatham's _Mines_ deals with this in a different way: it generates the mine positions in such a way that they can never lead to an ambiguous state during a game. https://www.chiark.greenend.org.uk/~sgtatham/puzzles/doc/min...

yshklarov 5 days ago | parent [-]

That's pretty neat. I wonder how it works. It's not obvious to me at all how to build something like this, as the program doesn't know the sequence in which the player will reveal the tiles.

I also once made my own variant of this (just like gregfjohnson's idea): A "lucky minesweeper" where luck can be toggled on/off at any point during the game: https://github.com/yshklarov/minesweeper

OscarCunningham 5 days ago | parent [-]

He's written a bit about how it works here: https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/mines....