# Thread: AI Contest - Minesweeper

1. There's no point in shuffling out first move bomb hits. If you hit one you lose and move on, in the end it should average out. thats the point of statistical sampling

2. ## the slider puzzle

Originally Posted by laserlight
Err... but isnt that puzzle mathematically unsolvable?
No. You see, the puzzle maker must follow the same rules that the player has to follow. If the maker can shuffle a piece and move it to the far right corner by switching it with the piece currently in that corner, then the player cannot solve the puzzle because the player cannot use the maker's rules. Which makes it mathematically predictable, even if it is only a small percentage that anyone will find a mathematic problem to determine the solution.

3. Only if the program uses a completely random method to place the tiles. If you design the scramble method to shuffle the tiles as you would on a real-life tactile board, this shouldn't be a problem.
Ah, I see. I had in mind the version where Llyod offered a prize for the solution.

Small confession to make: My current Honours project involves writing an AI to play Minesweeper Flags, the MSN version of the game. If you've never played it, it's almost like winmine.exe, except the object is to open mines, instead of avoiding them.
I probably should have placed bets that you were going to win... happened to look through your homepage shortly after you replied to my posts

4. Originally Posted by Decrypt
I was wondering about this. How can we all play the same boards if it's shuffled like that?
Well when you start it's the same board and it only changes if you pick a bomb, otherwise it's the same board and even if you do pick a bomb, only the 1 bomb moves, so it's still 99.9% the same board.

There's no point in shuffling out first move bomb hits. If you hit one you lose and move on, in the end it should average out. that's the point of statistical sampling
I agree, and originally that was the plan, However, since that's the rules the windows minesweeper uses, I modified mine to do the same to be consistent with it.

by the way, is the cell 0,0 going to be in the middle, top left, bottom right, top right, or bottom right?

/by the way, i'm a new member so you'll hear more and more from me. so consider this my hello/

6. Originally Posted by c89c
by the way, is the cell 0,0 going to be in the middle, top left, bottom right, top right, or bottom right?

/by the way, i'm a new member so you'll hear more and more from me. so consider this my hello/
0,0 is top left and welcome aboard

7. Haha!

I implemented my last rule and my score jumped up to 327495 with 103 wins out of 1000 games. I'm not sure how I got a score as close to Dante's with less than half as many wins, but no matter. A few more tweaks and I will be on top again.

8. H4X!!!!!

9. Darn... I'm getting < 40000! Don't think I'll submit this time. Good experience though.

And the program mysteriously crashes while displaying the scores, but only in loops; when I show scores manually it displays correctly

Hey! You all are using preboxed algorithms! No fair!

10. Originally Posted by jafet
Darn... I'm getting < 40000! Don't think I'll submit this time. Good experience though.

And the program mysteriously crashes while displaying the scores, but only in loops; when I show scores manually it displays correctly

Hey! You all are using preboxed algorithms! No fair!
If you downloaded the program the 1st day, you might have the 1st version where at the end when it prints the scores the players[i]->getName() was out of scope.

40000? Are you sure that's your score and not the simplebots score?

11. Originally Posted by jafet
Hey! You all are using preboxed algorithms! No fair!
I got up to 325000-340000 completely with my own algorithms based on how I play minesweeper in real life, so that's not exactly true.
Originally Posted by Dante Shamest
H4X!!!!!
But then, I used something mentioned in Darryl's link to make my "random" guessing better, and now my latest run took 8 minutes and gave this score:
Code:
```RandomBot: -611
SimpleBot: 35780
jlou: 532890```
(emphasis mine)

I think small changes in the algorithm can make big differences because of the bonus you get when you solve the puzzle. In a different run I counted 382 total solved (for a score of 539908).

Just something for you all to shoot for.

12. Originally Posted by jlou
In a different run I counted 382 total solved (for a score of 539908).

Wow, my morale has just suffered a big blow. Doubt I'll be able to improve my algorithm much better.

Actually I could remove the limiter I mentioned earlier, but it probably won't finish running even after the Iraq war ends.

13. Ackk... don't be discouraged.

Everything I did is basically discussed briefly in Darryl's minedefuser link (I haven't read the pdf link yet). There were a few implementation details that I didn't think of right away that helped a lot when I added them. And of course the idea for my last improvement above your score came from that link.

Keep thinking... Hopefully some others are trying as well. The basic AI isn't that hard at all (as indicated by the SimpleBot), so it shouldn't take too much effort to put forth an entry.

14. Originally Posted by jlou
Ackk... don't be discouraged.

Everything I did is basically discussed briefly in Darryl's minedefuser link (I haven't read the pdf link yet). There were a few implementation details that I didn't think of right away that helped a lot when I added them. And of course the idea for my last improvement above your score came from that link.
That's funny because the mine defuser didn't perform half as well as Dante's, so I guess coupled with your algo, you've super-charged it. Maybe you ought to contact it's author with the suggestions

15. I found a small bug in the minefield which is partly why our solve rates are so high. Basically, the "firstmove" check is allowing the first hit bomb to always be avoided even if it isn't actually in the first move. So everybody was getting one mulligan per game. Just moving the mFirstMove = false; code to the end of the uncoverSquare function changed my score to:
Code:
```RandomBot: -4206
SimpleBot: 20370
jlou: 332945
Solved: 269