Browse Source

Transférer les fichiers vers ''

master
BERDUGO Simon 3 years ago
parent
commit
803adf6a48
  1. 22
      projetjavascript.html

22
projetjavascript.html

@ -3,11 +3,13 @@
<body> <body>
<input type="text" id="name" required <input type="text" id="name" required
minlength="4" maxlength="8" size="10"> minlength="4" maxlength="8" size="10">
<button onclick="lancement()">lance le jeu</button> <button click="lancement()">lance le jeu</button>
<p id="demo"></p> <p id="demo"></p>
<script> <script>
let jeton_bac=1000;
let jeton_joueur=99; var jeton_bac=1000;
var jeton_joueur=99;
function lancement() { function lancement() {
let nb_jet = document.getElementById("name").value; let nb_jet = document.getElementById("name").value;
@ -54,23 +56,15 @@ function nbAlea(){
} }
let cars = nbAlea(); let cars = nbAlea();
window.alert(cars); window.alert(cars);
if (cars[0] == 9 && cars[1] == 9 && cars[2] == 9){ if(cars[0]==9&&cars[1]==9&&cars[2]==9){
document.getElementById("demo").innerHTML = "simon est gays"; document.getElementById("demo").innerHTML = "simon est gays";
gain(1); gain(1);
} }
else if (cars[0] == cars[1] && cars[0] == cars[2] ){ else if(cars[0]==cars[1]||cars[0]==cars[2]||cars[1]==cars[2]){
document.getElementById("demo").innerHTML = "bruno est gays";
gain(2);
}
else if (cars[1] == cars[0] && cars[1] == cars[2]){
document.getElementById("demo").innerHTML = "bruno est gays";
gain(2);
}
else if (cars[2] == cars[0] && cars[2] == cars[1]){
document.getElementById("demo").innerHTML = "bruno est gays"; document.getElementById("demo").innerHTML = "bruno est gays";
gain(2); gain(2);
} }
else { else{
document.getElementById("demo").innerHTML = "samuel est gays"; document.getElementById("demo").innerHTML = "samuel est gays";
gain(3); gain(3);
} }

Loading…
Cancel
Save