First version of game algorithm.