JSFiddle - React, Tailwind, and code Playground

by ncubica

JavaScript

var userMoney = 10;
var userChoice = prompt("Okay young lad, you've got 3 choices, either you choose box 1, 2 or 3");
switch(userChoice){
    case "1":
        alert("Wow. You're just that lucky, you've got 10$ added to your account");
        userMoney += 20; //you put 10+10 = 20;
        if(confirm("Would you like to see how much money you've got lad?")){
            alert("your money: " + userMoney);
        }else{
            alert("Well lad I Guess that's the end of the game.");
        }
        break;
    case "2":
        alert("Oi, bad luck Brian better luck next time");
        break;    
    case "3":
        alert("Oi, bad luck Brian better luck next time");
        break;
    default:
        alert("Sorry I didn't understand you");
        break;        
}