Not sure what Xavier is doing, he hasn't replied to my email yet about how to collaborate on the weekend.
Anyways, I have created a Tic-Tac-Toe program in Eclipse. In a nutshell I installed stuff to make it work with Processing and real time collaboration, hoping to be able to work on it with Xavier. It uses an array to store the player's and the "AI's" moves. The player uses the mouse and clicks where it wants to go. The "AI" randomly chooses an empty space, so it is not that intelligent.
The array is 9 integers long, each one represents a space od the board like so:
A "0" means the space is empty, a "1" is an "X" (the player) and a "2" is an "O" (the "AI"). For example, if the integers in the array, respectively form 0-8, are "0,1,1,2,0,2,0,1,2" the board would look like the following
I made functions that test every term in the array for every possible way of winning; three across, three down and the two diagonal. If there is a winner, it writes a character to the serial port, "p" for a player win, "c" for an "AI" win and "t" if the board is filled. Arduino then plays a tone depending on who won.
In the future, I hope to make the AI smarter (possibly block and win), and implement this array system in Arduino os this game is portable. 9 buttons would be used for each space, while using the tactile display.