The first If


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 = true;
var youHit = Math.floor(Math.random() *2);
var damageThisRound = Math.floor(Math.random() * 5 + 1);
var totalDamage = 0;
while (slaying == false)
        if (youHit == 1)
            console.log("You hit the dragon!");
            console.log("You missed!");
       slaying = false; 

What am I missing here? O.o Please help.


"Make sure you log a message"

.. Did you?

Did you intend to?

What actions was it meant to carry out to end up printing something? Is it doing those things?


Nevermind...found it.

It's this: while (slaying == false)

It doesn't loop at all....


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