I am not good at combinatorics, but according to this website, there are 255,168 possible games. If you consider that I do not have to store any of the boards that win after 5 moves, it helps. I also dont have to store any of the boards after 6 moves, but I do at 7. But again not at 8, or 9.

In total I have to store all the boards with 1,3,5,or 7 moves which do not contain a winning sequence. I may not be good enough at math to calculate the exact number, but I know it is a lot

With rotations it would be 774, but if menace went first it would be 304.

]]>I think that while I try and figure out a way to handle the memory I might build a different version of an AI that uses hardcoded logic:

` ``Each square is an input Each square is an output Inputs can be 0,-1, or 1. The AI peices are -1 If an input is not 0, that input cannot be used for an output If a single row column or diagonal sums to 2, play the empty spot If more than one row column or diagonal sums to 2, resign If a row column or diagonal sums to -2, play the empty spot`

As of this point I have a very basic AI going, which randomly chooses a position and plays it. This means I created the playing interface for the AI, and am able to start building the logic. However, I would like opinions of which version of menace to implement: With mirroring/rotation, or without mirroring. I for some reason believe that without mirroring would be easier to implement, but am not sure.

` ``Unmirrored: X _ _ is different than _ _ X _ O _ _ O _ _ _ _ _ _ _ Mirrored: X _ _ is the same as _ _ X and _ _ _ _ O _ _ O _ _ O _ _ _ _ _ _ _ _ _ X`

I would also like suggestions on how to implement the memory for storing each gameboard. The only criteria is that it must be a list of 9 numbers which correspond to the places on the board. I can convert lists to strings, but my thought was a matrix for each move. This would only require 4 matricies. Each matrix would correspond to a turn that MENACE makes. [G] would contain gameboard states for menaces 1st move, where each line represents a gameboard state. -1 would be used to indicate a position which has already been played. This would mean that [G] would look something like this, with the 0's being the partial probability of each layout after the first move. I can then use my list of moves which have been played to determine which line of the matrix is the current gameboard. I could then load that row into the probability list, make the selection and repeat. However, There are thousands of different gameboards that could be played, so i might have to narrow it to a subset based on the moves already played

` ``-1 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 0 -1 0 0 0 0 0 0 0 0 0 -1`