Skip to content

Instantly share code, notes, and snippets.

@thejsj
Created November 21, 2016 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejsj/cfaa52671cb1c3cd130434d86a86bc83 to your computer and use it in GitHub Desktop.
Save thejsj/cfaa52671cb1c3cd130434d86a86bc83 to your computer and use it in GitHub Desktop.
Ejemplos Para Jaime
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