
X O X - How Check the movement of Computer
Dear Friends,
Can any one help me please ?
I have a control array from 0-8
and it's look like that:
---------------
| X | | |
| | | |
---------------
| | O | |
| | | |
---------------
| | | |
| | | |
---------------
let's say that the computer start and put the (O) circle
in the middle, after the user put (X).
Rules :
1) the first one that complete tree XXX Or OOO in row or in diagonal
Wins
2) Computer will never Lose.
So, My internal conflict is how can icheck and keep that the computer
will play correct and will not lose ?
Thank You Very Much
Best Regards To All
==================
==================
Adi