C Board  

Go Back   C Board > Community Boards > Contests Board

Reply
 
LinkBack Thread Tools Display Modes
Old 03-21-2006, 03:22 PM   #1
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
AI Contest - Minesweeper

Ok I know I had promised a Risk AI, and it is finished and ready to go, but I think because of the complexity there wasn't enough interest (between 2 websites even), so I am gonna hold onto it for a bit. Anyway, what I do have is a much simpler AI that even beginners may fair well at while still giving a challenge to the regulars ....drum roll please............

Announcing: A Minesweeper AI contest:

Rules:
1. You are to derive a class from the provided Player class.
2. Please remit by email (littled at gmail) one file .h or .hpp to me with your implementation.
3. You must overide all virtual functions
4. If your implementation crashes my computer or locks it up in an infinite loop you will be disqualified.
5. Entries should be submitted by April 8th 12:00pm EST
6. Winning: The player receiving the highest score wins.
7. Scoring is as follows: 1000 random boards will be created. Each player will play each of the boards. Every square you uncover that is not a bomb, you get 1 point. every time you blow up, you lose 5 points. If you complete a board(uncover all non-bombs) you get 500 points.
8. You may not call srand() in your code.
9. You may not use any tricks to call/read private members of the minefield class
10. A reference to the minefield class is passed to your class in the getMove() call. You can call any public method it has. See code below for available methods.
11. I will post a test framework in a few days, but initially I don't want to distract from the task at hand.
12. FYI: the gridsize/bomb count used is equivilent to the expert level in the windows version
13. More FYI: When instanciating a base class player, it typically scores -200 just randomly picking squares. I have created a slightly better than random player that typically scores around 20000. Both of these will be playing, but should be easy to beat. I might also enter an unofficial advance player if I have time.
14. Even More FYI: Maximum achievable points = 881000, min = -5000, Max with no wins = 375000
15. NEW The first move is guaranteed non-bomb, and because of this, I have revised scoring system.
16. NEW Not really new, but I didn't mention it before. Returning an invalid position or a square that is already uncovered will be treated as a BOMB!

17. The most important rule: Have Fun!!!

Code:
Code removed in favor of download of code
Get Code Here

Last edited by Darryl; 03-22-2006 at 08:33 AM.
Darryl is offline   Reply With Quote
Old 03-21-2006, 04:32 PM   #2
Cheesy Poofs!
 
PJYelton's Avatar
 
Join Date: Sep 2002
Location: Boulder
Posts: 1,728
Just out of curiosity, any way to alleviate the possibility of a strong AI accidentally clicking on a bomb as his first pick every time?
PJYelton is offline   Reply With Quote
Old 03-22-2006, 12:28 AM   #3
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
Quote:
Originally Posted by PJYelton
Just out of curiosity, any way to alleviate the possibility of a strong AI accidentally clicking on a bomb as his first pick every time?
Well, I thought about that, and I remember the discussion here a while back, however since there are so many runs, every AI will have it's share of bad luck (roughly 1 of every 5). The betters ones should still come out ahead in the long run in the scoring.


*** UPDATE ***
I just found out that the windows minesweeper guarantees the first click is not a bomb, so I guess I will do the same.

Last edited by Darryl; 03-22-2006 at 01:23 AM.
Darryl is offline   Reply With Quote
Old 03-30-2006, 05:35 AM   #4
Even death may die...
 
Dante Shamest's Avatar
 
Join Date: Apr 2003
Location: Malaysia
Posts: 970
Darryl, there are no header guards in minefield.h. If I include it in my own header file, there are linker errors.

So can I assume that you'll definitely include it before including my header file?

Edit:

Another thing, does your framework support cascading like the Windows version? In other words, when I click on a mine that has no surrounding bombs, it uncovers its neighbours until a square that has surrounding bombs is found?

Last edited by Dante Shamest; 03-30-2006 at 11:48 AM.
Dante Shamest is offline   Reply With Quote
Old 04-01-2006, 12:51 AM   #5
Moderately Rabid
 
Decrypt's Avatar
 
Join Date: Feb 2005
Location: Milwaukee, WI, USA
Posts: 300
Quote:
Another thing, does your framework support cascading like the Windows version?
I don't think so, given the code for his SimpleBot. Unless I'm understanding the code all wrong, the SimpleBot's method is to clear out all around any 0's, then pick a random number if there are no 0's to be had.
__________________
There is a difference between tedious and difficult.
Decrypt is offline   Reply With Quote
Old 04-01-2006, 03:03 AM   #6
Software Developer
 
jverkoey's Avatar
 
Join Date: Feb 2003
Location: University of Waterloo
Posts: 1,916
Will the number of mines in the field be constant? Also, is there any way of determining how many mines remain to be uncovered?

Last edited by jverkoey; 04-01-2006 at 03:16 AM.
jverkoey is offline   Reply With Quote
Old 04-03-2006, 02:30 AM   #7
Registered User
 
Join Date: Mar 2006
Posts: 726
Quote:
Will the number of mines in the field be constant?
Quote:
14. Even More FYI: Maximum achievable points = 881000, min = -5000, Max with no wins = 375000
Probably.



First time joining a code contest!
jafet is offline   Reply With Quote
Old 04-03-2006, 07:58 AM   #8
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
Quote:
Will the number of mines in the field be constant?
Sorry, I didn't see this earlier, but yes, I am duplicating the expert level on windows minesweeper that uses 99 bombs...(though the framework is flexible, and just for kicks I may try out the beginners's and intermediate as well) Also, you are not uncovering bombs, you are uncovering non-bombs and leaving the bombs covered. In the real game you flag them, but that's just for us humans with bad memories, you ai should be able to track where the bombs are without flagging them.

Quote:
Another thing, does your framework support cascading like the Windows version?
I don't think so, given the code for his SimpleBot. Unless I'm understanding the code all wrong, the SimpleBot's method is to clear out all around any 0's, then pick a random number if there are no 0's to be had.
That's correct, you must manually clear out the 0's .... That feature in windows I would say is for the benefit of human playability.

Quote:
Darryl, there are no header guards in minefield.h. If I include it in my own header file, there are linker errors.

So can I assume that you'll definitely include it before including my header file?
That was the plan, to include my header before the players. I would had put everything in one big cpp file but I think it would had been a tad confusing ( or a tad more :-)

(I don't seem to be able to edit my original post, but when you hit a bomb it's -9 points and not 5)

Last edited by Darryl; 04-03-2006 at 08:13 AM.
Darryl is offline   Reply With Quote
Old 04-03-2006, 08:11 AM   #9
Software Developer
 
jverkoey's Avatar
 
Join Date: Feb 2003
Location: University of Waterloo
Posts: 1,916
"Also, is there any way of determining how many mines remain to be uncovered?"
jverkoey is offline   Reply With Quote
Old 04-03-2006, 08:24 AM   #10
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
Quote:
Originally Posted by jverkoey
"Also, is there any way of determining how many mines remain to be uncovered?"
I just edited above that you aren't uncovering bomb but instead, non-bombs there are 480 squares to begin, 99 have bombs, so 381 are non-bombs which need to be uncovered. The game will not end until they all are uncovered or you uncover a bomb. In any event, it should be fairly easy to track how many are left to uncover.
Darryl is offline   Reply With Quote
Old 04-03-2006, 08:28 AM   #11
Software Developer
 
jverkoey's Avatar
 
Join Date: Feb 2003
Location: University of Waterloo
Posts: 1,916
Ah hah, sorry, didn't see the edit.
jverkoey is offline   Reply With Quote
Old 04-04-2006, 04:33 AM   #12
Registered User
 
Join Date: Mar 2006
Posts: 726
One more... we can be *guaranteed* that each instance of our Player-s will one game and only one, right? I feel like caching parts of the board each move, just for kicks.
jafet is offline   Reply With Quote
Old 04-04-2006, 07:54 AM   #13
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
Quote:
Originally Posted by jafet
One more... we can be *guaranteed* that each instance of our Player-s will one game and only one, right? I feel like caching parts of the board each move, just for kicks.
The players are local variables created in a loop, so each iteration of the loop recreates your player that then plays one game, so yes it is guaranteed.

Last edited by Darryl; 04-04-2006 at 08:04 AM.
Darryl is offline   Reply With Quote
Old 04-07-2006, 02:15 PM   #14
Cheesy Poofs!
 
PJYelton's Avatar
 
Join Date: Sep 2002
Location: Boulder
Posts: 1,728
Home computer crashed so it looks like its unlikely I can submit an entry. Damn!!
PJYelton is offline   Reply With Quote
Old 04-07-2006, 02:36 PM   #15
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
I have a few people that want to sumbit but running short on time..and since next weekend is a long holiday weekend here in Cayman (Good Friday and Easter Monday are holidays here) I will extend it till the 15th of April, just submit along with your taxes :-)
Darryl is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 05:18 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22