Math is not defined


ReferenceError: math is not defined

Can anyone please tell me why i'm getting this error? I'v commented out everything but my variables. Am I somehow missing something? All my research suggests i'm using this correctly.

var yourStrike = math.floor(math.random() * 10 + 1);
var enemyStrike = math.floor(math.random() * 10 + 1);
var yourHealth = 10;
var enemyHealth = 10;

var freedom = prompt("You have been challenged to personal combat by a rival King. Do you ACCEPT the challenge. RIDE AWAY on your steed and let the Army Handle it, or GROVEL?").toUpperCase();  /*
switch(freedom) {
    case 'ACCEPT':
        var pCombat = true;
        console.log("Noble choice! You're men cheer you on as you take your place before them.");
        while(pCombat) {
        if(yourStrike < 5) {
            console.log("His armor has deflected your strike!");
            enemyHealth -= yourStrike;
      } else if(yourStrike > 5) {
          console.log("You strike a solid blow, crippling the enemy.");
      } else {
            console.log("You strike the head from his shoulders, becoming legend!");
            pCombat = false;


Math is with uppercase M


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