You'd define a 3x3 array of integers, all values start out at 0 (0=empty space), when someone puts an X in a space, put a 1 in that spot in the array, for an O put a 2. Don't change anything that isn't zero. At the end of every turn, check for all possible wining conditions for both sides.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment