alexandre_lab
07-21-2003, 02:31 PM
hello everyone !
i'm trying to create a flash tictactoe game in which the user fights against the computer.
[ ] [ X ] [ ]
[ ] [ o ] [ o ]
[ X ] [ o ] [ ]
... things like that. the computer handles the O ... the aim is to be the first to have its three signs aligned either horizontally, vertically or in diagonals.
I'm trying to design the AI, but my Natural Intelligence does not foresee the way... :(
how do u program the desire to win in the least number of attempts?
It will always be the computer that will start.
At first, i thought about storing the values in a nine-element array, gradually replacing each eleemnt with either 'X' or 'O'. Each time it would be the computer's turn, it would pick a random number in between the remaining available slots in the array.
But 'random' is not the fastest way to win ( it's more Artificial Dumbness :D )
any idea on how to proceed ?
thanks for your help,
Alexandre
i'm trying to create a flash tictactoe game in which the user fights against the computer.
[ ] [ X ] [ ]
[ ] [ o ] [ o ]
[ X ] [ o ] [ ]
... things like that. the computer handles the O ... the aim is to be the first to have its three signs aligned either horizontally, vertically or in diagonals.
I'm trying to design the AI, but my Natural Intelligence does not foresee the way... :(
how do u program the desire to win in the least number of attempts?
It will always be the computer that will start.
At first, i thought about storing the values in a nine-element array, gradually replacing each eleemnt with either 'X' or 'O'. Each time it would be the computer's turn, it would pick a random number in between the remaining available slots in the array.
But 'random' is not the fastest way to win ( it's more Artificial Dumbness :D )
any idea on how to proceed ?
thanks for your help,
Alexandre