2. declare your variable math random


#1

Every time i try and run my code it tells me to capitalize the m in Math.random anyone know what's wrong?
var slaying = true ;
// A bit of new math magic to calculate the odds
// of hitting the dragon. We'll cover this soon!
var youHit = Math.floor(Math.random() * 2);
var damageThisRound = Math.floor(Math.random() * 5 + 1);
var totalDamage = 0;

`


#2

right, i tripled checked it. The problem are the comments..... I will report this, this shouldn't be, remove the comments:

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

and you should be good


#3

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