MANEJO DE APLICACIONES PARA JUEGOS - USO DE RAMDOM
<html>
<script>
function procesar()
{
var aleatorio = Math.random();
alert (aleatorio);
aleatorio = (aleatorio *6) + 1;
var x= Math.trunc(aleatorio)
alert (x);
numero.value=x;
}
</script>
<body>
PRACTICA DE NUMEROS ALEATORIOS <P>
<FORM NAME="DATOS">
NUMERO
<INPUT TYPE="TEXT" NAME="numero"> <P>
<input type="button" onclick="procesar ()"
name="r" id="r" value="GENERAR ALEATORIO"> <p>
</FORM>
<BODY>
</HTML>
Comentarios
Publicar un comentario