From c8d13e084a0cf3b4f8da933c6fa8503ffeff22a8 Mon Sep 17 00:00:00 2001 From: Mykola Syniavskyi Date: Sat, 14 Jun 2025 02:57:41 +0000 Subject: [PATCH] =?UTF-8?q?P=C5=99idat=20du8/game.h?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du8/game.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 du8/game.h diff --git a/du8/game.h b/du8/game.h new file mode 100644 index 0000000..0c4e07b --- /dev/null +++ b/du8/game.h @@ -0,0 +1,19 @@ +#ifndef GAME_H +#define GAME_H + +typedef enum { EMPTY = '.', PLAYER_X = 'X', PLAYER_O = 'O' } Cell; + +typedef struct { + Cell board[3][3]; + int current_player; + int game_over; + int winner; +} GameState; + +void init_game(GameState* game); +void draw_game(GameState* game); +void handle_input(GameState* game, int key); +int check_winner(GameState* game); + +#endif +