Did you create a variable called user?


#1

OK, so I did this:
var hihead = prompt("How are you? STONED, NORMAL or DOWN?").toUpperCase();

switch(hihead) {
case 'STONED':
var grams = prompt("Lots of weed. You smoked it (YES or NO)?").toUpperCase();
var bluntSize = prompt("Did u used that big paper (YES or NO)?").toUpperCase();
if (grams === 'YES'|| bluntSize === 'YES') {
console.log("You needed to smoke third of that to get very high. U are stoned!");
}else{
console.log("you cant get high from smoking paper only.You are not stoned!");
}
break;
case 'NORMAL':
var peopleNO = prompt("Did more than 3 people smoked that blunt(YES or NO)?").toUpperCase();
var wind = prompt("Was there strong wind blowing(YES or NO)?").toUpperCase();
if (peopleNO ==='YES'|| bluntSize === 'YES') {
console.log("Well, you are somewhat high, nothing mind consuming.");
}else{
console.log("The wind smoked it or you are immune to weed.");
}
break;
case 'DOWN':
var heroin = prompt("Did you snorted heroin(YES or NO)?").toUpperCase();
var needle = prompt("Maybe u shot yourself with that needle(YES or NO)?").toUpperCase();
if (heroin ==='YES'|| needle === 'YES') {
console.log("U shot yourself pretty good, crackhead.");
}else{
console.log("Could be that your dog diededed. Try to get yourself up.");
}
break;
default:
console.log("I didn't understand your choice. Hit Run and try again, this time picking STONED, NORMAL, or DOWN!");
}

But I keep getting : Oops, try again. Did you create a variable called user?


#2

Nevermind. I had to use user as an variable at the beginning.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.