Implementation of mini-max algorithm, demonstrated on generalized tic-tac-toe.