function stand(){
if(gethandvalue(playerhand) < dealerhand ){
document.getElementById("game-status").innerHTML = "you lose";
}
if(gethandvalue(playerhand) === dealerhand){
document.getElementById("game-status").innerHTML =" its a tie";
}
else(gethandvalue(playerhand) > dealerhand)
document.getElementById("game-status").innerHTML ="you win!";
youwinsound.play();
}
when the dealer's hand gets higher than the player hand the code still pints out "you win"
Aucun commentaire:
Enregistrer un commentaire