Aqui dejo mi trabajo
<meta charset="UTF-8">
<h1>PROGRAMA JUEGO DE ADIVINACION </h1>
<script>
    function saltarLinea() {
        document.write("<br>");    
        document.write("<br>");    
        document.write("<br>");    
    }  
    function imprimir(frase) {
        document.write(frase);
        saltarLinea();
    } 
    function sorteo() { 
            return Math.round(Math.random()*10);
        }
    var numeroAleatorio = sorteo() ;
    var numeroUsuario = parseInt(prompt("Ingrese un número entre 0-10"));
    if (numeroAleatorio == numeroUsuario) {
        imprimir("Usted acertó con el número " + numeroAleatorio);
    }
    else {
        imprimir("Usted no acertó, el número era " + numeroAleatorio);
    }
</script> 
            