If your problem is just Tic-Tac-Toe, then you can present your board like my program http://pastie.org/1715115
This is a ternary matrix of numbers. The board is a 9-digit number, where each digit has one of three possible values: 0 for empty, 1 for x and 2 for o.
This approach is great for minimax, as the board can be installed in one piece! The matrix has the form:
int suc[TOTAL][2]={ { 0, 10000}, { 1, 20001}, { 10, 20010}, { 12, 1012}, { 21, 1021}, { 100, 20100}, { 102, 100102}, ...
where each pair of numbers corresponds to (a) the current position and (b) the next best position, previously calculated minimax. So, if the board is empty (suc [0] [0] == 0), the next best position is to put "x" at position 5, that is, the center (suc [0] [1] == 000010000)
In fact, with this program you donβt even need to create minimax, since this program has already calculated all possible answers in the ad-hoc matrix. The most important function, in order to choose the next step, was done by a simple search for the success matrix (successor):
int move(int terno) { int i; for (i=0; i<TOTAL; i++) if (suc[i][0]==terno) return suc[i][1]; return 0; }
This is a good approach for quantum algorithms (and embedded systems). Hope this helps you.
Take care