Skip to content

Commit

Permalink
Ajuste no app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rcaneppele committed Feb 14, 2024
1 parent 22b1aa1 commit d367d8b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
alert('Boas vindas ao jogo do número secreto');
let numeroSecreto = parseInt(Math.random() * 100 + 1);
let numeroMaximo = 5000;
let numeroSecreto = parseInt(Math.random() * numeroMaximo + 1);
console.log(numeroSecreto);
let chute;
let tentativas = 1;

// enquanto chute não for igual ao n.s.
while (chute != numeroSecreto) {
chute = prompt('Escolha um número entre 1 e 100');
chute = prompt(`Escolha um número entre 1 e ${numeroMaximo}`);
// se chute for igual ao número secreto
if (chute == numeroSecreto) {
break;
Expand Down

0 comments on commit d367d8b

Please sign in to comment.