Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <head>
- <title> Roulette </title>
- <h1> Roulette </h1>
- </head>
- <body>
- <h2> Regole della roulette </h2>
- <p> Scommetti una puntata minima di 2 euro, la massima è illimitata. </p>
- <p> Vinci il doppio della puntata</p>
- <script type="text/javascript">
- function lancio()
- {
- var x = Math.floor((Math.random() * 37) + 0),n_scommesso,puntata;
- document.getElementById("numero").innerHTML = x;
- puntata= Number(document.getElementById("puntata").value) <!----qua andrà inserito l'importo sul quale si vuole scommettere >
- if (x == n_scommesso)
- {
- document.getElementById("vincita").innerHTML = "Hai vinto" ;
- }
- else
- {
- document.getElementById("perdita").innerHTML = "Hai perso" ;
- }
- }
- function numero() {
- var n_scommesso; <!----qua andrà inserito il numero sul quale si vuole scommettere >
- n_scommesso=Number(document.getElementById("n_scommesso").value);
- }
- </script>
- <button type="button" onclick = "lancio()"> Gioca </button>
- <p id="numero"></p>
- <p id="vincita"></p>
- <p id="perdita"></p>
- Inserisci l'importo sul quale vuoi scommettere <input id="puntata" type="number" min="2"><hr>
- Su quale numero vuoi scommettere? <input id="n_scommesso" type="number"><hr>
- </body>
- </html>
- <!----http://previews.123rf.com/images/michelangelus/michelangelus1404/michelangelus140400017/27368520-Europeo-vettore-tavolo-della-roulette-Archivio-Fotografico.jpg>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement