Created
November 21, 2016 06:00
-
-
Save thejsj/cfaa52671cb1c3cd130434d86a86bc83 to your computer and use it in GitHub Desktop.
Ejemplos Para Jaime
This file contains hidden or 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("Where you at?").toUpperCase(); | |
var isSingle = prompt("Are you single?").match(/yes/); | |
var isHappy = prompt("Are you happy?").match(/yes/); | |
switch(user) { | |
case 'HOME': | |
console.log("it is nice to have a home"); | |
break; | |
case 'PARK': | |
console.log("must be nice outside"); | |
break; | |
case 'SCHOOL': | |
console.log("school is the best"); | |
break; | |
case 'BED': | |
if (isSingle && isHappy) { | |
console.log("good night! Glad you're not sleeping by yourself!"); | |
} else if (isSingle || isHappy) { | |
console.log("On to the next one!"); | |
} else { | |
console.log("It's called online dating...."); | |
} | |
default: | |
console.log("i dont know where dat at"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment