hola chicos estaba en la clase de Math.floor y Math.random pero cuando intente lo que los intructores hacian en el video para mi no funciono,no se que puse,por favor alguien podria orientarme porque la pagina html de la clase no lee este codigo
let SecretNumber =math.floor(math.random()*10)+1;
let UserNumber = 0;
let Attempts =1;
//let wordtries="try";
let maximumTry=3;
while (UserNumber != SecretNumber) {
UserNumber = prompt("enter a number between 1 and 10 ");
console.log(UserNumber);
if (UserNumber == SecretNumber) {
alert (`you got it,the right number is: ${UserNumber}. you did it in ${Attempts} ${Attempts == 1 ? "try":"tries"}`);
} else {
if (UserNumber > SecretNumber) {
alert ("the secrete number is minor");
} else {
alert ('the number is higher');
}
//we increse the counter when it doesn't find the right answer
//Attempts = Attempts + 1;
Attempts++;
//wordtries = "tries";
if (Attempts > 3) {
alert ("you reached the maximum number of attempts");
break;
}
}
}