|
|
@ -1,24 +1,29 @@ |
|
|
|
<!DOCTYPE html> |
|
|
|
<html> |
|
|
|
<body> |
|
|
|
<input type="text" id="name" required |
|
|
|
minlength="4" maxlength="8" size="10"> |
|
|
|
<button onclick="lancement()">lance le jeu</button> |
|
|
|
<script> |
|
|
|
var jeton_bac=1000; |
|
|
|
var jeton_joueur=99; |
|
|
|
function lancement() { |
|
|
|
var nb_jet = document.getElementById("name").value; |
|
|
|
if (jeton_joueur > nb_jet && jeton_bac > 500 && nb_jet < 100 && nb_jet> 0){document.write(11);} |
|
|
|
else{document.write("tu as mis trop de jetons");} |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
<script> |
|
|
|
var jeton_jac=1000; |
|
|
|
var jeton_joueur=100; |
|
|
|
function myFunction() { |
|
|
|
var x = document.getElementById("name").value; |
|
|
|
document.write(x);} |
|
|
|
function nbAlea(){ |
|
|
|
const cars = [Math.floor(Math.random() * 10) , |
|
|
|
Math.floor(Math.random() * 10) , |
|
|
|
Math.floor(Math.random() * 10) ]; |
|
|
|
document.write(cars); |
|
|
|
} |
|
|
|
nbAlea() |
|
|
|
nbAlea(); |
|
|
|
|
|
|
|
</script> |
|
|
|
<button onclick="myFunction()">Validé</button> |
|
|
|
<input type="text" id="name" required |
|
|
|
minlength="4" maxlength="8" size="10"> |
|
|
|
</body> |
|
|
|
</html> |
|
|
|
|
|
|
|