News for hackers. Stuff that matters.
Re:How to Write your own Minesweeper AI by endoself on Monday December 24, 2012 @01:02AM (#4962044)
Nice algorithm. That's pretty close to optimal. There is one improvement you missed, though it's not obvious how to implement it and I'm not sure how helpful it would be. When you aren't sure what to do, you assign probabilities in order to guess which square to click, but you could also estimate how useful each square would be.

There might be one square that's unlikely to contain a mine, but also unlikely to help much in solving the rest of the board. You might even be able to infer exactly what it will be before you click on it. Then, if there is another square that's a bit more likely to have a mine but also more likely to help, you can click on that one instead.

Re:How to Write your own Minesweeper AI by JoachimSchipper on Monday December 24, 2012 @07:21AM (#4962657)
You could just simulate a run of your algorithm against all the possible configurations left. Even with the segmenting trick from the article, this will sometimes be far too slow; but e.g. trying it for 10 seconds before terminating the computation may help.