Přidat du8/game.h
This commit is contained in:
parent
d43d643858
commit
c8d13e084a
19
du8/game.h
Normal file
19
du8/game.h
Normal 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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user