Version 1.1: better input validation, new end-of-game logic, disabled back button.