Code Your Own Adventure 2!


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661

So I created the "game" pretty quickly to understand the concept of the logical operators so please bare with the random things i wrote. I passed the course, but the problem i was having was the prompt popping up. I run the game and it directly prints the default: . When the first prompt pops up i type in YES and prints the default and says I completed the course. The next prompt I wrote doesn't pop up.

Replace this line with your code. 

var user=prompt("Would you like to play our dating game? YES or NO").toUpperCase();

switch(user)
{
    case 'Asia':
        var asianGirls=prompt("Do you like Asian girls? YES or NO").toUpperCase();
        break;
        case 'Hispanic':
        var latino=prompt("ooo you like latino girls? YES or NO") .toUpperCase();
    
        if(Asian==='YES'||Hispanic==='YES')
        {console.log ("Those are great choices")}
            
        else{
            console.log ("no worries we can find the right match for you")
        }
            break;
        case 'White':
            var blonde=prompt("Who doesn't like white girls?") .toUpperCase();
            if(White&&Asian==='NO'){
                console.log ("we gona find you the right one cuz")
            }
            break;
            default:
            console.log("Oh so you don't like any of these choices?");
}

https://www.codecademy.com/en/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661


#2

actually I figured out the problem!


#3

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