Created
December 10, 2014 13:56
-
-
Save Pugio/16dd0a0f8ece7d506ac5 to your computer and use it in GitHub Desktop.
Text based adventure.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set up the rooms/scenes | |
var Prompts = { A: "You are in room A. The doors are B, C.", | |
B: "You are in room B. The doors are A, D.", | |
C: "You are in room C. The doors are A, D.", | |
D: "You are in room D. The doors are B, C." | |
}; | |
// start here | |
var response = prompt(Prompts['A']); | |
while (response != "X") { | |
response = prompt(Prompts[response]); | |
} | |
alert("You have been eaten by a Grue!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment