Author |
Message |
fatboy316
|
Posted: Tue Apr 27, 2004 12:27 pm Post subject: how to make AI for connect four |
|
|
i've searched for ways to make AI for connect four but i can't seem to understand, is there a method to use in turing for alpha-beta pruning or the minmax algorithm? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Tue Apr 27, 2004 12:35 pm Post subject: (No subject) |
|
|
there's nothing build into turing, so you'd have to program the entire thing yourself - if that's what you asking. If you ned help encoding your AI, start off with posting your pseudoalgorythm |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
fatboy316
|
Posted: Tue Apr 27, 2004 1:28 pm Post subject: (No subject) |
|
|
wats a pseudoalgorythm |
|
|
|
|
|
Cervantes
|
Posted: Tue Apr 27, 2004 1:50 pm Post subject: (No subject) |
|
|
its an algorythm in pseudo code. pseudo code is code, but not of a specific language.
so your pseudoalgorythm is basically how you plan to do it. |
|
|
|
|
|
omni
|
Posted: Tue Apr 27, 2004 2:32 pm Post subject: (No subject) |
|
|
also called pseudocode. Its your plan on how to program your specific algorithm, this case AI. You go through and decide what the AI will do.
ex: if it sees a place to get a connect four, then place the piece there, otherwise do something else. Then you transfer it to code.
ex: if connectfour =true then
/*place piece there*/
else
/*do something else*/
end if
.... |
|
|
|
|
|
fatboy316
|
Posted: Sat May 15, 2004 5:15 pm Post subject: (No subject) |
|
|
i don't no where to start for my connect four ai, i've been reading sites around and there seems to be an algorithm to weigh each move and give it a number, then the highest number will be the action taken. Rite now my program checks for win, if can't win then block, if can't block then connect3, if can't connect3 then block3, else it'lld o a random move. its easily beaten rite now |
|
|
|
|
|
omni
|
Posted: Sat May 15, 2004 5:58 pm Post subject: (No subject) |
|
|
really? what you said right there seems pretty good. Ya its hard to get a program to think like a human does.
Can your AI look ahead one move? |
|
|
|
|
|
SuperGenius
|
Posted: Sat May 15, 2004 9:52 pm Post subject: (No subject) |
|
|
I made a connect 4 game a while back, and I was thinking of developing an AI for it, but I gave up on it because it seemed pretty hard. I would like to see some code if you manage to come up with something. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Sun May 16, 2004 1:17 pm Post subject: (No subject) |
|
|
fatboy316 - its nice to see you getting somewhere with your AI, but don't make too many threads on the same topic... or atleast keep them linked |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
fatboy316
|
Posted: Thu May 27, 2004 3:45 pm Post subject: (No subject) |
|
|
i've sorta got my ai, but how can i make it better and possibly look ahead into the game? my program and the other thread i posted is at http://www.compsci.ca/v2/viewtopic.php?t=4983
please help! this is due in a week! |
|
|
|
|
|
guruguru
|
Posted: Thu May 27, 2004 4:19 pm Post subject: (No subject) |
|
|
A weeks a lot of time don't worry! Unless you want to get into a little recursion or more advanced algorithsm (or really long if statements ) I suggest you leave the AI as it is. It seems pretty good from what you've said, so dun worry.
Connect 4 can't really be much more advanced. Make powerups like extra move if you go in a certain column? I dunno... |
|
|
|
|
|
fatboy316
|
Posted: Thu May 27, 2004 4:28 pm Post subject: (No subject) |
|
|
thx for help but i was wondering about the AI and how to make it better, would it be better if i was able to make a procedure to play the game out, and then determine the winner and if you end up as the winner, continue with that move or if u end up a loser, then go onto the next best move |
|
|
|
|
|
s_climax
|
Posted: Thu May 27, 2004 6:05 pm Post subject: (No subject) |
|
|
But how can you predict what the other person will do? |
|
|
|
|
|
Cervantes
|
Posted: Thu May 27, 2004 6:35 pm Post subject: (No subject) |
|
|
i think better AI would be:
connect4
block 4
place one to create two 3 ina rows
block 3
build a 2inarow near to another 2 in a row
build 2 (anywhere on screen)
block 2
random move
and have a predefined starting move in the centre.
just a suggestion |
|
|
|
|
|
fatboy316
|
Posted: Thu May 27, 2004 6:53 pm Post subject: (No subject) |
|
|
s_climax wrote: But how can you predict what the other person will do?
i can basically create a game scenario where it plays the game using the AI as 2 separate players. The AI chooses the best moves for each player and assumes that the REAL player will make the best move as well
other AI suggestions are welcome on how i can improve it |
|
|
|
|
|
|