Created
March 24, 2013 17:38
-
-
Save lijiang2087/5232774 to your computer and use it in GitHub Desktop.
This gist has been created from CodeCred.me
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
var user = prompt ("How are you getting to your meeting? DRIVE, BUS, or WALK").toUpperCase(); | |
switch(user){ | |
case 'DRIVE': | |
var fast = prompt("Are you fast? YES or NO?").toUpperCase(); | |
var agile = prompt("Are you agile? YES or NO?").toUpperCase(); | |
if (fast === "YES" && agile === "YES"){ | |
console.log("Yes, fast and agile gets you there on time."); | |
} else { | |
console.log("Drive fast and break things"); | |
} | |
break; | |
case 'BUS': | |
var construction = prompt("Is there construction?").toUpperCase(); | |
var raining = prompt("Is it raining?").toUpperCase(); | |
if (construction === "YES" || raining === "Yes"){ | |
console.log("You are never getting there."); | |
} else { | |
console.log("Don't forget your Clipper card and god speed!"); | |
} | |
break; | |
case 'WALK': | |
console.log("Avoid the Tenderloin"); | |
break; | |
default: | |
console.log("I'm sorry, how are you getting there again?"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment