![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programming Guru
![]() |
Binary Game Challenge
Okay, I've got a challenge for you people experienced or wanting to be experienced in programming an AI.
The task is to write a program that will try to defeat the other AI in a test of logical thinking in a mathematical game. The game is as follows: - The board is a random string of binary, 10 characters long. - When it's your turn you can change any 0 to 1 (but not a 1 to 0), and reverse a number to the left of the first if you choose. Before: 0110011001 Valid Turns: 1110011001, 0111111001, 0110011101 - The winner is the one who makes the binary strand all 1s The program when run must: - Read the board from 'board.dat' in the same folder as the exe (it will be stored as the number stated plainly: 1010101010 for example). - Execute one valid move. - Replace the board in 'board.dat' with the updated one in the same format. - The program will then end. It can be programmed in any language, as long as it can be run as an exe without any prompts. The judging program will randomize a board and save it to board.dat, then simultaneously run each program until the board is 1111111111. Then with the same combination change who went first and run again. It will repeat this 100 times and summarize the report. I will post the reports for fun in this thread so you can see who your AI can beat. This is all just for fun on your own time. No contest, but you can treat it as one if you wish. Just submit the program any time if you wish (along with the source). I guarantee you you'll learn something new about AIs :o (unless you're an expert, you know who you are). Good luck. :banana: |
|
|
|
|
|
#2 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Seems like doing this over stdin and stdout would be faster and allow thinking about more than the current situation.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#3 |
|
Programming Guru
![]() |
Well, if you think about it, all the program needs is the current situation.
If you play the game, you'll notice each turn will need to think for its own. The strategy is to make the best move for your current situation. Think of it like tic-tac-toe. Given a board mid-point in game, you can make the perfect move without knowing what has been done or what should be done in the future, given your knowledge of the game is sufficient. So if you teach the program enough about the Binary Game, it will be able to result in a perfect move out of every situation without any prerequesites (if there is such thing as a perfect game). Mind you, I haven't studied very far in to this game. Maybe a perfect game is very easy, we'll have to find out. Edit: PLUS, I want this to be open to any language. Even something as simple as BASIC or OOT. |
|
|
|
|
|
#4 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Using stdin and stdout wouldn't affect the ability of languages to participate. Console I/O is equally as common as file I/O.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#5 |
|
The Oblivious One
Join Date: May 2005
Location: Ontario, Canada
Posts: 644
Rep Power: 4
![]() |
Exactly. Stdin stands for standard input (usually a keyboard) and stdout stands for standard output (usually your monitor). (saves you having to search)
__________________
Dr. Zoidberg: [ecstatic] I'm going to a movie... with FRIENDS! |
|
|
|
|
|
#6 |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
You can redirect them on Windows by setting some special process start parameters (Super easy in C#) or in *nix by...forking isn't it?
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
|
#7 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
Quote:
|
|
|
|
|
|
|
#8 |
|
Programming Guru
![]() |
Dameon, that still seems a little out of the way to do. =/
Arevos, correct and correct. There is no number left of the first. |
|
|
|
|
|
#9 |
|
Programming Guru
![]() |
The way i see it is the difference is...
program.exe data.dat program.exe < data.dat As for programming it, it's just about as far apart in most languages as well... I think Sane's original idea -- reading from a file -- will do just as well since we won't be sending it more than one situation or doing any real time analysis... My todo list for the very close future is the thing for element, and doing something in C for this...
__________________
|
|
|
|
|
|
#10 | |
|
Troll
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4
![]() |
Quote:
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270 |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|