Possible bug in the system?

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

Here is the code.

Oops, try again. Make sure you capitalize Math in Math.floor() and Math.random()!

here is the error.

This is from learn javscript, dragon slayer.

I litteraly copied and pasted this code from the original code provided. I also ran this exact same code in the next secton of the course and it worked. (Note that the section which gave me this error was only section 2, declare your variables.)

So I have come to a conclusion that section 2 may have a bug in it?

Also note that I tried this on 2 serperate computers, on 2 seperate ip addresses. So I don’t think it is just this computer.

Also note that I already tried reseting the code, and copying and pasting again.

Also note that this topic is similar to another topic about this problem that other people also had. But that topic didn’t recieve too many responses. So try try again right?

So weird… Your code works for me. I have no idea why it’s doing that.

did you try it in section 2 of javascript dragon slayer, declaring variables?

Because this exact code worked for me aswell…but not in section 2 for some odd reason.

1 Like

yes, in section 2, sorry it’s not working

Only in section two? Odd, I did this lesson a few months ago, didn’t finish the course though. You could try running it in a different browser, yes, codecademy has been quite buggy since the update.

1 Like

One day i tried it again and it magically worked, inconsistent but worked

1 Like

Sorry that happened… I think that things are just getting updated right now, so it’s probably just buggy in general. Glad you can move on now! I know it sucks to be stuck. JS is a good course too.

yes weight off my shoulders

1 Like