An interesting puzzle to solve. Code to play the game written in cpp