I've put together some code for playing noughts and crosses / tic tac toe (against the computer), which uses the MiniMax algorithm. It works ok so I've tried to modify it to play Reversi / Othello, but I've got stuck trying to undo the moves. With tic tac toe you can undo a move by just setting the board position to empty, but you can't do this with reversi
because making a move causes other pieces to change colour. I've tried making a copy of the board array before making a move and before the recursive call to nextMove and using this to restore the board (in place of myBoard[i][j] = VACANT), but it doesn't work. Any help would be much appreciated!
(I've deleted most of the code from the method, but hopefully this bit makes sense)
[ Jess added UBB
[code] tags to perserve whitespace ]
[ August 26, 2004: Message edited by: Jessica Sant ]