Algorithm of the game is done