20 lines
359 B
C
20 lines
359 B
C
#ifndef GAME_H
|
|
#define GAME_H
|
|
|
|
#define SIZE 3
|
|
|
|
typedef enum { EMPTY, X, O } Cell;
|
|
typedef struct {
|
|
Cell board[SIZE][SIZE];
|
|
int current_player;
|
|
int cursor_x, cursor_y;
|
|
int game_over;
|
|
Cell winner;
|
|
} GameState;
|
|
|
|
void game_init(GameState *game);
|
|
void draw(void *state);
|
|
void update(void *state);
|
|
void key_handler(int key, void *state);
|
|
|
|
#endif |