Stand on 21 if we ask for a hit
This commit is contained in:
@@ -303,9 +303,16 @@ static void begin_playing(bool tap_control_on) {
|
|||||||
display_score(dealer.score, WATCH_POSITION_TOP_RIGHT);
|
display_score(dealer.score, WATCH_POSITION_TOP_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void perform_stand(void) {
|
||||||
|
game_state = BJ_DEALER_PLAYING;
|
||||||
|
watch_display_text(WATCH_POSITION_BOTTOM, "Stnd");
|
||||||
|
display_score(player.score, WATCH_POSITION_SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
static void perform_hit(void) {
|
static void perform_hit(void) {
|
||||||
if (player.score == 21) {
|
if (player.score == 21) {
|
||||||
return; // Assume hitting on 21 is a mistake and ignore
|
perform_stand();
|
||||||
|
return; // Assume hitting on 21 is a mistake and stand
|
||||||
}
|
}
|
||||||
give_card(&player);
|
give_card(&player);
|
||||||
if (player.score > 21) {
|
if (player.score > 21) {
|
||||||
@@ -315,12 +322,6 @@ static void perform_hit(void) {
|
|||||||
display_score(player.score, WATCH_POSITION_SECONDS);
|
display_score(player.score, WATCH_POSITION_SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void perform_stand(void) {
|
|
||||||
game_state = BJ_DEALER_PLAYING;
|
|
||||||
watch_display_text(WATCH_POSITION_BOTTOM, "Stnd");
|
|
||||||
display_score(player.score, WATCH_POSITION_SECONDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void dealer_performs_hits(void) {
|
static void dealer_performs_hits(void) {
|
||||||
give_card(&dealer);
|
give_card(&dealer);
|
||||||
display_dealer_hand();
|
display_dealer_hand();
|
||||||
|
|||||||
Reference in New Issue
Block a user