<meta charset="UTF-8">
<h1>PROGRAMA LOTERIA</h1>
<script>
function saltarLinea() {
document.write("<br>");
document.write("<br>");
document.write("<br>");
}
function imprimir(frase) {
document.write(frase);
saltarLinea();
}
function sorteo(n) {
return Math.round(Math.random()*n);
}
var numeroLanzado = parseInt(prompt("Ingrese un número entre 0-10"));
var numeroPensado = sorteo(numeroLanzado);
if (numeroPensado == numeroLanzado) {
imprimir("Adivinaste el numero");
} else {
imprimir("No adivinaste, el numero correcto era: " + numeroPensado);
}
</script>