▲ | OscarCunningham 5 days ago | |||||||
Yeah, it's NP-complete to decide whether a cell in Minesweeper must be a mine: https://logic.pku.edu.cn/ann_attachments/np.pdf. In practice I suspect a SAT solver would make quick work of the positions that actually appear in games. | ||||||||
▲ | maggit 5 days ago | parent [-] | |||||||
There was a Minesweeper on here that used a SAT solver, but I cannot find it at the moment. As I recall, it never had any issue with resolving the board quickly. I think it dynamically resolved where the mines would be as you played the game, and if you clicked a square that could be a mine, it would be a mine, except, I believe, when there were no open squares that were safe. (Edit: Here it is! https://pwmarcz.pl/kaboom/ And the write-up: https://pwmarcz.pl/blog/kaboom/ ) This is similar in spirit to my take on the game: https://magnushoff.com/articles/minesweeper/ Unfortunately, not being familiar with SAT solvers, my implementation can grind to a halt in some configurations :) | ||||||||
|