From b6c8f03f97978d31eccd4d1bb4545e27b701994f Mon Sep 17 00:00:00 2001 From: _N3m0 Date: Fri, 15 Mar 2024 13:53:08 +0100 Subject: [PATCH] show timer --- main.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/main.c b/main.c index d8402b4..c0cba96 100644 --- a/main.c +++ b/main.c @@ -1,5 +1,5 @@ -#include #include +#include #include #include #include @@ -59,6 +59,7 @@ const Color text_color = BLACK; const Color hover_color = RED; float timer = 0.0f; +char timer_text[10] = {0}; int need_to_fill = 1; #define INIT_TEXTURE(img, tex) \ @@ -178,13 +179,12 @@ void fill_game(int click_x, int click_y) int x = rand() % game_size.x; int y = rand() % game_size.y; - if (click_x == x && click_y == y) - continue; - - if (game[y][x] == 'X') + if ((click_x == x && click_y == y) || game[y][x] == 'X') { i--; - else - game[y][x] = 'X'; + continue; + } + + game[y][x] = 'X'; } for (int x=0; x