let numeroMaximoposible =100;
let numeroSecreto = Math.floor (Math.random()*numeroMaximoposible)+1;
let numeroUsuario =0;
let intentos =1;
//let PalabaraVeces = "VEZ";
let maximosIntentos = 7;
//console.log(numeroSecreto);
while ( numeroUsuario != numeroSecreto) {
let numeroUsuario = parseInt(prompt(Me indicas un numero del 1 y ${numeroMaximoposible} por favor:
));
console.log(typeof(numeroUsuario));
if (numeroUsuario == numeroSecreto) {
//ACERTAMOS FUE VERDADERA LA CONDICIÓN
alert(ACERTASTE EL NUMERO ES: ${numeroUsuario}. LO HICISTE EN ${intentos} ${intentos == 1 ? 'vez' : 'veces'}
);
} else
if(numeroUsuario > numeroSecreto) {
alert("EL NUMERO SECRETO ES MENOR");
} else {
alert("EL NUMERO SECRETO ES MAYOR")
}
//INCREMENTAMOS EL CONTADOR CUANDO NO ACIERTA
//intentos = intentos +1;
//intentos =+ 1;
intentos++;
//PalabaraVeces = 'veces';
if (intentos > maximosIntentos) {
alert(LLEGASTE AL NUMERO MAXIMO DE ${maximosIntentos} INTENTOS
);
break;
}
//LA CONDICIÓN NO SE CUMPLIÓ
//alert("LO SIENTO, NO ACERTASTE EL NUMERO")
}