Clash Royale ain't gonna work


#1

Hey guys… my game code WILL not run at all now what’s wrong?

alert("All answers must be typed. Please note that answers typed with CAPS LOCK on is optional.");
var clashRoyale = confirm("Welcome to the Arena, Challenger! To Enter the Full game, you must Beat me. The Creator.");
if (clashRoyale) {
    alert("Well then. Prepare for the Battle to start your Journey in the World of Clash Royale.");
} else {
    alert("Well then, if you don't want to fight, I won't fight");
}
if (clashRoyale === false) {
    alert("I lied... I WILL WIN!");
} else {
    alert("I will defeat you!");
}
alert("I , the Creator, Choose " + cardtype() + "!");
function cardtype() {
 return "Pekka";   
}
var ClashRoyale = prompt("The Creator played a Pekka. What will you play? a SKELETON ARMY, a MINION HORDE, or a GOLEM").toUpperCase();
switch(ClashRoyale){
    case 'SKELETON ARMY':
        var hit = confirm("Are you sure you want to play that card?");
        if(hit) {
            alert("The Pekka Dies.");
            } else {
                alert("You can't quit in this battle! HAHAHA!!!");
            }
            break;
    case 'MINION HORDE':
        var hit2 = confirm("Are you sure you want to play that card?");
        if(hit2) {
            alert("The Pekka dies");
        } else {
            alert("You can't quit in this battle! HAHAHA!!!");
        }
        break;
        case 'GOLEM':
            var hit3 = confirm("Are you sure you want to play that card?");
            if(hit3) {
                alert("The Golem distracts the Pekka and gives you time.");
            } else {
                alert("You can\'t quit in this battle! HAHAHA!!!You can't quit in this battle! HAHAHA!!!"); 
            }
            break;
            default:
            alert("You can\'t play that card");
}
alert("I Choose " + cardype() + "!");
function cardype() {
    return "Valkyrie";   
}
var hit1 = prompt("The Creator played a Valkyrie. What will you play? a MINION HORDE, a GOLEM, or BARBARIANS").toUpperCase();
    switch(hit1){
        case 'MINION HORDE':
            var hit4 = confirm("Are you sure you want to play that card?");
            if (hit4) {
                alert("The Valkyrie dies, and you deal 1000 damage to a crown tower");
            } else {
                alert("You can't quit in this battle! HAHAHA!!!");
            }
            break;
        case 'GOLEM':
            var hit5 = confirm("Are you sure you want to play that card?");
            if (hit5) {
                alert("You Successfully defended!");
            } else {
                alert("You can't quit in this battle! HAHAHA!!!");
    }
    break;
    case 'BARBARIANS':
        var hit6 = confirm("Are you sure you want to play that card?");
        if(hit6) {
            alert("Both Troops die");
        } else {
            alert("You can't quit in this battle! HAHAHA!!!");
        }
    break;
    default:
    alert("What card is that?");
    }
    alert("I , the Creator, Chose " + cardtyp() + "!");
function cardtyp() {
 return "Fireball";   
}
    var Hit = prompt("The Creator played a Fireball. You can't counter that. What card do you want to play? ELITE BARBARIANS, a VALKYRIE, or FIRE SPIRITS").toUpperCase();
    switch(Hit){
        case 'ELITE BARBARIANS':
            var hit7 = confirm("Are you sure you want to play that card?");
            if(hit7) {
                alert("You take down one crown tower");
            } else {
                alert("You can't quit in this battle! HAHAHA!!!");
            }
            break;
            case 'VALKYRIE':
                var hit8 = confirm("Are you sure you want to play this card?");
                if(hit8) {
                    alert("You take down one crown tower, and deal 120 damage to the king tower");
                } else {
                    alert("You can't quit in this battle! HAHAHA!!!");
                }
                break;
                case 'FIRE SPIRITS':
                    var hit9 = confirm("Are you sure you want to play that card?");
                    if(hit9) {
                        alert("You deal 90 damage to one of the crown towers");
                    } else {
                        alert("You can't quit in this battle! HAHAHA!!!");
                    }
                    break;
                    default:
                    alert("What card is that?");
    }
    alert("The Creator took down your right tower.");
    alert("I Choose " + cardtye() + "!");
function cardtye() {
 return "Tombstone";   
}
    var card1 = prompt("The Creator played a Tombstone card, it's easily countered but can be overwhelming. What do you want to play? A MINI PEKKA, a FIREBALL, or ARCHERS").toUpperCase();
    switch(card1){
        case 'MINI PEKKA':
            var hit10 = confirm("Are you sure you want to play that card?");
            if(hit10) {
                alert("You took down The Creators Left Tower.");
            } else {
                alert("You can't quit in this battle! HAHAHA!!!|");
            }
            break;
            case 'FIREBALL':
                var hit11 = confirm("Are you sure you want to play that card?");
                if (hit11) {
                    alert("You deal 2000 to The Creators King Tower");
                } else {
                    alert("You can't quit in this battle! HAHAHA!!!");
                }
                break;
                case 'ARCHERS':
                    var hit12 = confirm("Are you sure you want to play that card?");
                    if (hit12) {
                        alert("You deal 200 damage to the King tower.");
                    } else {
                        alert("You can't quit in this battle! HAHAHA!!!");
                    }
                    break;
                    default:
                    alert("What card is that?");
    }
alert("Overtime +60 seconds");
    alert("I Choose " + cardtpe() + "!");
function cardtpe() {
 return "Pekka";   
}
var overtime = prompt("You have to take down another Crown tower to beat The Creator. What do you play? a PEKKA, a  ROCKET, or ELITE BARBARIANS?").toUpperCase();
    switch(overtime){
        case "PEKKA":
            var crown1 = confirm("Are you sure you want to plya that card?");
            if(crown1){
                alert("You take down The Creator's King Tower!")   
            } else {
                alert("You can't quit in this battle! HAHAHA!!!");
            }
        break;
        case"ROCKET":
            var crown2 = confirm("Are you sure you want to play that card?");
            if(crown2){
                var crown3 = confirm("200 HP left on the King's Tower! another card and you can win! FIREBALL, PEKKA, or BALLOON?");
                switch(crown3){
                    case"FIREBALL":
                        alert("Wow! you beat me.... Have fun in the full game. Download it on iOS or Android");
                        break;
                        case"PEKKA":
                             alert("Wow! you beat me.... Have fun in the full game. Download it on iOS or Android");
                        break;
                        case"BALLOON":
                             alert("Wow! you beat me.... Have fun in the full game. Download it on iOS or Android");
                        break;
                        default:
                        alert("What card is that?");
    }
    } else {
        alert("You can't quit in this battle! HAHAHA!!!");
    }
    break;
    case"ELITE BARBARIANS":
        var crown4 = confirm("Are you sure you want to plya that card?");
        if(crown4) {} else {}
    break;

I do know that the last if/else statement is empty. how does it not work now?


#2

UPDATE: I figured it out… Last curly bracket was missing.

https://www.codecademy.com/SuperN3rd02/codebits/Pdy6cc