Skip to content

Commit

Permalink
Update blackjack_conuter.c
Browse files Browse the repository at this point in the history
  • Loading branch information
grugnoymeme authored Dec 7, 2023
1 parent 223928e commit 3c8baa9
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions blackjack_conuter.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,16 @@ static void vibration_hot_count() {
return;
}

// static void app_draw_callback(Canvas* canvas, void* ctx) {
// UNUSED(ctx);

// canvas_clear(canvas);
// char count_str[5];
// snprintf(count_str, 5, "%d", count); // Converti il conteggio in stringa per disegnarlo
// canvas_draw_str(canvas, 44, 24, count_str);
// }

static void app_draw_callback(Canvas* canvas, void* ctx) {
UNUSED(ctx);

canvas_clear(canvas);
char count_str[5];
snprintf(count_str, 5, "%d", count);

int text_width = canvas_glyph_width(canvas, count_str);
int x = (128 - text_width) / 2;
int y = 40; // Posizione y per centrare il testo in basso

canvas_draw_str(canvas, x, y, count_str);
snprintf(count_str, 5, "%d", count); // Converti il conteggio in stringa per disegnarlo
canvas_draw_str(canvas, 44, 24, count_str);

// Aggiungi le informazioni sul conteggio delle carte
canvas_draw_str(canvas, 0, 54, "Cards # 2-7= +1, 8 & 9= 0, and 10-Ace= -1");

// Aggiungi la descrizione della vibrazione quando il conteggio è "hot"
canvas_draw_str(canvas, 0, 60, "Vibrates the running count in pulses when count is hot");
}

Expand Down

0 comments on commit 3c8baa9

Please sign in to comment.