sacha.serny 3 years ago
parent
commit
052db05d30
  1. 13
      app.js
  2. 6
      index.html

13
app.js

@ -39,20 +39,15 @@ function regle() {
document.body.appendChild(button); document.body.appendChild(button);
} }
*/ */
function jeu() {
var machine_coins = 1000 var machine_coins = 1000
var player_coins = 100 var player_coins = 100
while (player_coins > 0) { function jeu() {
userinput = prompt() // a dev
if (player_coins > 0) {
userinput = document.getElementById("mise").value // a dev
console.log(userinput) console.log(userinput)
while (userinput > 100 || userinput < 0) {
console.log("A")
// Ask
}
var tirage = [nbAlea(), nbAlea(), nbAlea()] var tirage = [nbAlea(), nbAlea(), nbAlea()]
console.log(tirage) console.log(tirage)
gain(tirage) gain(tirage)
} }
} }

6
index.html

@ -7,7 +7,11 @@
<title>Document</title> <title>Document</title>
</head> </head>
<body> <body>
<h1 onclick="regle()">MACHINE A SOUS NSI</h1> <h1 onclick="">MACHINE A SOUS NSI</h1>
<form action="">
<input type="text" id="mise">
<input onclick="jeu()" type="button" value="Submit" id="valider">
</form>
<script src="app.js"></script> <script src="app.js"></script>
</body> </body>
</html> </html>
Loading…
Cancel
Save