21: Calculate the Score

21: Calculate the Score

// calculate score
if(card_drawn=="Ace"){
 card_value = 14;
 current_score+=card_value;
}
else if (card_drawn=="King"){
 card_value = 13;
 current_score+=card_value;
}
else if (card_drawn=="Queen"){
 card_value = 12;
 current_score+=card_value;
}
else if (card_drawn=="Jack"){
 card_value = 11;
 current_score+=card_value;
}
else{
 card_value = parseInt(card_drawn);
 current_score += card_value;
}
Comments are closed.