Thread: AI Contest - Minesweeper

  1. #46
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    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. #47
    Registered User
    Join Date
    Apr 2006
    Posts
    22

    Lightbulb the slider puzzle

    Quote 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. #48
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    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
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #49
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Quote 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.
    Last edited by Darryl; 04-12-2006 at 05:16 AM.

  5. #50
    Registered User
    Join Date
    Apr 2006
    Posts
    22

    Talking about the contest.

    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. #51
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Quote 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. #52
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    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. #53
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    H4X!!!!!

  9. #54
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    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!
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

  10. #55
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Quote 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. #56
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    Quote 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.
    Quote 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. #57
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Quote 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. #58
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    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. #59
    Tropical Coder Darryl's Avatar
    Join Date
    Mar 2005
    Location
    Cayman Islands
    Posts
    503
    Quote 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. #60
    Registered User jlou's Avatar
    Join Date
    Jul 2003
    Posts
    1,090
    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
    Bad (negative score): 260
    Slightly more reasonable, but still absurdly high.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Action Game - AI Contest
    By Queatrix in forum Contests Board
    Replies: 4
    Last Post: 01-18-2007, 06:55 PM
  2. New AI contest: sign up
    By Sang-drax in forum Contests Board
    Replies: 20
    Last Post: 07-27-2005, 05:54 PM
  3. chess ai contest
    By Raven Arkadon in forum Contests Board
    Replies: 7
    Last Post: 07-09-2005, 06:38 AM
  4. AI Contest Proposal
    By MadCow257 in forum Contests Board
    Replies: 4
    Last Post: 03-13-2005, 03:27 PM
  5. Game Design Topic #1 - AI Behavior
    By TechWins in forum Game Programming
    Replies: 13
    Last Post: 10-11-2002, 10:35 AM