Created
March 14, 2017 15:39
-
-
Save ivandevp/028f64dff08b7374a5e6e21d7235516b to your computer and use it in GitHub Desktop.
Adivina el número en JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var numero = parseInt(prompt("Ingresa un número (del 1 al 10):")); | |
var numeroAleatorio = Math.floor(Math.random() * 10); | |
debugger; | |
if (numeroAleatorio === numero) { | |
console.log("Adivinaste!"); | |
} else { | |
console.log("Perdiste! El número es " + numeroAleatorio); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment