Přidat du8/game.h

This commit is contained in:
Mykola Syniavskyi 2025-06-14 02:57:41 +00:00
parent d43d643858
commit c8d13e084a

19
du8/game.h Normal file
View File

@ -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