Here is a simple implementation of the minimax algorithm for the game of Tic Tac Toe in MATLAB:
main.m1702 chars51 lines
Note that this implementation assumes that the maximizing player is X and the minimizing player is O. You may need to modify the implementation to fit your specific implementation of the game.
gistlibby LogSnag