Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <doctype html>
  2. <html lang="it">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Urbini scommesse</title>
  6. <style type="text/css">
  7. .inserimento{
  8. height: 30px;
  9. width: 170px;
  10. font-family: fantasy;
  11. font-size: 30px;
  12. text-align: center;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <script type="text/javascript">
  18. function dadi(){
  19. var dado1,dado2,scommessa,puntata,dadi,risultato;
  20. scommessa=document.getElementById("s").value;
  21. dado1=Math.floor(Math.random() * 6) + 1;
  22. dado2=Math.floor(Math.random() * 6) + 1;
  23. dadi=dado1+dado2;
  24.  
  25. if ((dadi<7) && (scommessa<7)){
  26. document.getElementById("risultato").innerHTML ="hai vinto<br> " + dadi ;
  27. }
  28. else{
  29. document.getElementById("risultato").innerHTML ="non hai vinto<br> " + dadi ;
  30. }
  31. }
  32. </script>
  33. <h1>Under-Over 7 </h1>
  34. <h2>Regole:</h2>
  35. <p>Si fanno le puntate sul risultato del lancio dei dadi. Vengono accettati solo tre tipi di scommesse:
  36. Una scommessa di denaro alla pari che il totale sarà inferiore a 7.
  37. Una scommessa di denaro alla pari che il totale sarà superiore a 7.
  38. Una scommessa che il totale sarà proprio 7.
  39. Si lanciano i dadi.Vengono pagate le scommesse vincenti e si incassano quelle perdenti a seconda del risultato del lancio.</p>
  40. <form>
  41.  
  42. <br>
  43. <input class="inserimento" style="color:red" id="s" type="number">
  44.  
  45. <input id="bottone" type="button" name="esegui" value="CALCOLA" onclick="dadi()">
  46.  
  47. <p id="risultato"></p>
  48. </form>
  49.  
  50. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement