Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

Minesweeper

Yesterday I wrote a little program to play Minesweeper so I could graph what the likelihood of winning was given certain bomb densities.

Over 19,000 games:



(The X axis is bomb density, Y is winning percentage)

Currently the AI only flags bombs based on O(n) algorithms. I don't do any hypothetical-true-leads-to-inconsistent-state eliminations which get into exponential time, though I'll probably add that sometime.

Of course, sometimes it's just a 50/50 chance and no logic will help.

BOARD 511:

 1 2 X 2 1   1 1 1   1 1 2 1 1   1 * * 1       1 * 2 * 1 1 * * 2
 3 * . * 2   1 * 2 1 2 * 3 * 1 1 2 3 2 1   1 1 2 1 2 1 2 2 4 * 2
 * * * * 2   1 2 * 1 2 * 3 1 1 2 * 2 1 1 2 2 * 2 2 2 2 2 * 2 2 2
 3 4 3 3 3 2 1 1 1 1 1 1 1     2 * 3 2 * 3 * 4 * 2 * * 2 1 2 2 *
 * 2   1 * * 2       1 1 1     1 1 2 * 2 3 * 3 1 2 2 3 2 1 2 * 3
 * 3 1 1 4 * 4 1     1 * 1         2 2 3 3 3 2       1 * 1 2 * 2
 2 * 1   2 * * 1 1 1 2 1 2 1 1 1 1 2 * 3 * * 1   1 1 3 2 2 1 2 2
 2 2 2   1 3 3 2 1 * 1 1 2 * 1 1 * 3 3 * 3 2 1   2 * 4 * 1   1 *
 1 * 2 2 2 3 * 3 2 1 1 1 * 3 2 1 1 2 * 2 2 1 1   3 * * 2 2 1 3 2
 1 1 2 * * 3 * * 2 1 1 3 4 * 2     1 1 1 1 * 1 1 3 * 3 1 2 * 4 *
     1 2 2 2 3 * 2 1 * 2 * * 4 3 3 2 1   1 2 2 2 * 3 3 2 4 * 4 *
       1 1 1 1 2 2 2 1 2 2 3 * * * * 1     2 * 3 2 * 2 * * 2 2 1
       1 * 1 1 2 * 1       1 2 5 * 4 1     2 * 2 1 2 3 3 3 2 2 1
       2 2 2 1 * 2 1         1 3 * 3 1     2 2 2   1 * 1 1 * 3 *
 1 1 1 1 * 1 1 1 1       1 1 2 * 3 * 1     1 * 1   1 1 1 1 2 4 *
 1 * 1 1 1 1             1 * 2 1 2 1 1     1 1 1           1 * 2
DEAD!
Tags: img
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 28 comments
Previous
← Ctrl ← Alt
Next
Ctrl → Alt →
Previous
← Ctrl ← Alt
Next
Ctrl → Alt →