PVJC25/du8/game.h

20 lines
366 B
C

#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