well, the approach i would take is using a 3x3 array
int array[3][3];
then determine if you want x's or o's to go first. Display the contents of the array in ascii on the screen and ask them where to put their mark
1|2|3
-+-+-
4|5|6
-+-+-
7|8|9
write an algorithm to make the computer think by weighing each open spot and chances that it could win if it placed a mark in the spot. Basicly determine the possible lines you could draw to win.
Also, look at the oponent and determine if they can win next move and place a blocking mark in their path.
That would be the gist of how I would go about designing this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.