Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
- <title>JavaScript while loop</title>
- </head>
- <body>
- <!-- File: listing-7-11.htm -->
- <script type="text/javascript">
- <!--
- var intDieValue=Math.floor(Math.random()*6);
- intDieValue++;
- while(intDieValue != 6)
- {
- document.write("You threw a " + intDieValue + "<br/>");
- intDieValue=Math.floor(Math.random()*6);
- intDieValue++;
- }
- document.write("You threw a " + intDieValue + " - game over! <br/>");
- // -->
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement