While loop dragon slayer


#1

finer details cant seem to be hard to find
Dragon slayer seems not that obvious to interpret even with the math coding.

https://www.codecademy.com/courses/javascript-beginner-en-mrTNH-6VIZ9/0/3?curriculum_id=506324b3a7dffd00020bf661#

Your code doesn't look quite right. Check the Hint if you need help!

var slaying = true;
var youHit = Math.floor(Math.random()*2)
var damageThisRound = Math.floor(Math.random()*5 + 1)
var totalDamage = 0;

while(slaying){
    console("Die you mythical beast?")
        slaying = false
    }

#2

Its fine I solved it I just had to switch the values of slaying. And I passed to the next activity.:grinning:


#3

and the " ; " should be added by the bottom "slaying" variable.


#4

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