Airport Customs Game

For the final part of lesson 5 of Codecademy's Javascript course you have to write your own little "operators" game. Mine is posted below. We also learned a new command.

.toUpperCase();

It changes the output of the previous function to all caps so the user can enter "yes", "Yes" or "YES" and any answer is accepted.

The Adventure at Airport Customs.

var user = prompt("You're at the customs desk of an international airport. The customs officer wants to know if you have anything to declare. Do you feign IGNORANCE, BRIBE the officer or RUN?").toUpperCase();
switch(user) {
    case "IGNORANCE":
        var declare = prompt("The officer, thinking you're an idiot, explains what it means to 'declare' something. Do you have anything do declare? YES or NO?").toUpperCase();
        var smuggle = prompt("Are you hiding something from the customs officer? YES or NO").toUpperCase();
        if (declare === 'NO' && smuggle === 'NO') {
            console.log("That was easy. Let's go have some fun!");
        }
        else if (declare === 'NO' && smuggle === 'YES') {
            console.log("The officer didn't believe you. You should work on that nervous twitch if you're going to smuggle Kinder Surprize. Looks like it's time for the latex gloves.");
        }
        else if (declare === 'YES' && smuggle === 'NO') {
            console.log("The officer is not happy that you're wasting his time. Leave quickly before he starts asking more questions.");
        }
        else {
            console.log("The officer is not interested in your 'contraband'. He tells you to take your candy and leave!");
        }
        break;
    case "BRIBE":
        var amount = prompt("You're a risk taker, aren't you? Do you hand the officer 5 dollars or 100?").toUpperCase();
        var method = prompt("Do you place the bribe inside your PASSPORT or do you just take it straight from your WALLET?").toUpperCase();
        if (amount === '5' || method === 'WALLET') {
            console.log("The officer is not amused. Looks like you'll be spending the night in lockup.");
        }
        else {
            console.log("The officer smiles and hopes you enjoy your stay. Now get out of here.");
        }
        break;
    case "RUN":
        var speed = prompt("That's risky. Are you fast? YES or NO?").toUpperCase();
        var intellect = prompt("I hope you're smart. Are you? YES or NO?").toUpperCase();
        if (intellect === 'YES') {
            console.log("No, you're not smart. You have nowhere to run and end up being cuffed on the bathroom floor. Nice.");
        }
        else {
            console.log("Well, that went well. What's it like having your face smashed into a runway while being cuffed by a burly customs officer?");
        }
        break;
    default:
        console.log("I don't think you can do that. Maybe you should try IGNORANCE, a BRIBE, or RUN.");
}