Re: TIB: Artificial Intelligence
[Prev][Next][Index][Thread]
Re: TIB: Artificial Intelligence
I made a tic tac toe game for the PC not too long ago like that. I use an
array with nine numbers that all start at 0. The computer moves into the box
that has the highest value. When I move, the boxes around where I go are
increased in value by one point so that the computer is more likely to move
there next turn. If it senses that I have 2 next to each other, the 3rd box
gets jacked up in value so it will block a winning move from me. You can
make it so that it is more offensive or defensive, like making the values
around itself higher in value is offensive and making the values around my
moves higher is defensive.
As for learning from its mistakes, I set it up to play 1,000 games against
itself..which it did, in about 3 seconds. Now I can't beat it any more...
-Jared C.
tivault.com
isignupnow.com
In a message dated 1/31/00 9:40:50 PM Central Standard Time, ETTamme1@aol.com
writes:
> Me again, i just read it was tic tac toe. Matricies would be an ideal
> medium to work with for this AI, But youll still be stucck with A bunch of
> if
> thens, like i said before thats all AI is. Well that and obviously the
> logic
> operators. um lets see..... i thinkin... Well actually you wouldnt
> need a bunch of if thens, only uhh lets see..1 2 3 4 5 6 7 8...
probablably
>
> around 16. Just check to see if the three spaces will add up to 3. Youd
> have to store 1 in the spaces that the comp controlled and 2's in the
> players. and check to see if any of the two spaces adds up to 4 and put
a
>
> 1 in the space after it to screw the player. Obviously you can make this
> much more complex by weighting the moves so that after the AI has
determined
>
> which moves would be semi smart to make it can use the wieghts to
determine
> which it should choose of the ones available. Ok? its a bit vauge, but
its
> not tough so fiddle about with it and have some fun making the worlds
> smartest tic tac toe computer.... just kidding. If youve got questions on
> what ive said just drop a line.
> ~Eric