Original Post
Hi there. Ive been workin in a connect4 game, in c, and the algorithm ive done, is really simple and sometimes easy too beat. Heres the pseudo-code of it
See if comp can win
If so win it
See if player can win
If so block it
For cicle(stops when it has tested all possibilites, in this case 7 columns)
see if comp can create a line of 2 or 3 pieces in column I, and copies the number of "connected" pieces to a variable Y
see if puting the piece in that column will originate victory of the player
if so cicle restarts in next column
put variable the "play" in a binary tree
restart cicle
THe "play" thats gonna be played will be the one with the most "connected pieces"
Now i know this algorithm aint good and it has some flaws,so ive been trying to "upgrade" it to a better one and to implement "prediction", so that the computer can thinkin a play 2 or 3 turns in advance. Can you help me? Ive been searching this forum, but from what i see people here use minimax and alpha-beta algorithms. Can you give me a "help" or "tutorial" page for this algorithms, or can you help me upgrade my algorithm?
Thanks in advanced, and please dont flame me.
Thanks again!
[edited by - PacketLoss on May 23, 2003 12:39:05 PM]