try: exec(compile("room = 'starting'\ncoins = 0\ngame_running = True\n\nwhile game_running:\n if room == 'starting':\n print(\"You find yourself in a strange place. To your left, a giant door with two coin slots. To your right, a large, cavernous room\")\n print(\"If you want to try to unlock the door, enter '1'. To enter the big room, enter '2'\")\n answer = input(\"1-2: \")\n if answer == \"1\":\n room = \"door\"\n elif answer == \"2\":\n room = \"big\"\n else:\n print(\"Invalid input entered\")\n elif room == 'door':\n if coins >= 2:\n print(\"You win!\")\n game_running = False\n else:\n print(\"You need two coins to get through this door, but you only have \" + str(coins) + \"!\")\n room = 'starting'\n elif room == 'big':\n print(\"You have entered a the massive room. To your left, you see a math puzzle. To your left, you see a word puzzle.\")\n print(\"Enter '1' to do the math puzzle, enter '2' to do the word puzzle, enter '3' to go back to the starting room\")\n\n answer = input(\"1-3: \")\n\n if answer == \"1\":\n room = \"math\"\n elif answer == \"2\":\n room = \"word\"\n elif answer == \"3\":\n room = \"starting\"\n else:\n print(\"Invalid input entered\")\n elif room == \"math\":\n print(\"You see in front of you the following puzzle:\")\n print(\"3 + 4 x 2\")\n print(\"Choose your answer below:\")\n print(\"a: 8\")\n print(\"b: 11\")\n print(\"c: 14\")\n print(\"d: 18\")\n\n answer = input(\"a-d: \").lower()\n\n if answer == \"a\" or answer == \"c\" or answer == \"d\":\n print(\"Sorry, that is incorrect\")\n elif answer == \"b\":\n print(\"That is correct! You have been awarded 1 coin\")\n coins += 1\n room = \"big\"\n else:\n print(\"Invalid input entered\")\n elif room == \"word\":\n print(\"You see in front of you the following puzzle:\")\n print(\"Descramble the name of an animal: cnorcoa\")\n \n answer = input(\"Type out your answer: \").lower()\n\n if answer == \"raccoon\":\n print(\"That's correct! One coin has been awarded\")\n coins += 1\n room = \"big\"\n else:\n print(\"Sorry, that is incorrect\")\n print(\"\")", "script.py", "exec")) except SystemExit: pass