|
<html> <!-- roll.html Dave Reed --> <!-- This page simulates dice rolls until doubles are obtained. --> <!---------------------------------------------------------------->
<head> <title> Dice Stats </title> <script type="text/javascript" src="http://www.prenhall.com/reed/random.js"> </script> <script type="text/javascript"> var roll1, roll2;
roll1 = RandomInt(1, 6); roll1 = parseInt(roll1); roll2 = RandomInt(1, 6); // not using this for now document.writeln("You rolled a " + roll1 +"<br>"); while(roll1!=5){ roll1 = RandomInt(1, 6); roll1 = parseInt(roll1); document.writeln("You rolled a " + roll1 + "<br>"); } document.writeln("You finally rolled a 5!"); </script> </head>
<body> </body> </html>
|