pseudocode for the game logic