What the problem



Oops, try again. Make sure you log a message to the console to let the player knows if (s)he won or lost!

var slaying = false;
var youHit = Math.floor(Math.random()*2);
var damageThisRound = Math.floor(Math.random()*5+1);
var totalDamage = 0;
    console.log("you hit the dragon");
    if(youHit === 1){
        console.log("you slew the dragon!");
        slaying = false;
    } else{
        console.log("You're toast");
        slaying = false;


Shouldn't you start with true?


Yes, please change value of var slaying to true.


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