In Ultimate Tic-Tac-Toe you play 10 games at once, so it's a bit more interesting than regular tic tac toe. You take turns placing your marks on the 9 small boards within the big board. To win you must win 3 small boards in a row across the big board. Now here is where it gets interesting. When you place your mark, the cell you choose on the small board determines the board your opponent will play on. For instance if you place your mark in the upper left corner of the board you are playing, your opponent will have to play in the board in the upper left corner of the big board. The board helps you keep track of this by automatically highlighting the board that is played next. The board will also automatically detect if a small board has been won and mark it for you, and will also detect when the game has been won. The player going first can place their mark on any board they like. Also, if your move sends your opponent to a board that has already been won, the player can place their mark on any non-won board they like. All this lends an element of strategy to the game that is absent in normal tic-tac-toe, and makes this a lot more fun. Ultimate Tic-Tac-Toe is not my idea. See notes and credits below for a link to a blog post that talks more about it.
Status: Working, but unfinished. I would like to add keyboard control so two people can play without having to pass the mouse back and forth. ---------------------------- XKCD Comic mapping optimal tic tac toe moves: http://xkcd.com/832/ Blog post that prompted my interest in Ultimate Tic Tac Toe: http://mathwithbaddrawings.com/2013/06/16/ultimate-tic-tac-toe/ ---------------------------- My Notes ----------------------------------- Ok. Thinking about how to do win detection. Keep two lists, one for X positions, and one for O positions. The presents of opponent moves affect move choice for the player but does not affect the win states, so keep them separate. I will initalize two lists for the X and O board states and fill them 1 thru 81 with zeros. Then I can replace the 0 with a 1 at the index corresponding to the board position to keep the board state. Each board or the whole board needs to be represented in a data structure. I have each min-board numbered from left to right top to bottom like this 123 456 789 For each board there are 8 win states. 123, 456, 789, 147, 258, 369, 159, 357 Update the board state after each move. Only have to check the last board moved on for a win state so no worry about being super fast. Could just check for them all after each move on a board.