Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 how to make AI for connect four
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
fatboy316




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
fatboy316




PostPosted: Tue Apr 27, 2004 1:28 pm   Post subject: (No subject)

wats a pseudoalgorythm
Cervantes




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
fatboy316




PostPosted: 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




PostPosted: 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 Razz ) 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




PostPosted: 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




PostPosted: Thu May 27, 2004 6:05 pm   Post subject: (No subject)

But how can you predict what the other person will do?
Cervantes




PostPosted: 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




PostPosted: 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
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 21 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: