26 lines
516 B
C
26 lines
516 B
C
|
#ifndef BLOCUS_H
|
||
|
#define BLOCUS_H
|
||
|
|
||
|
#define EMPTY 0
|
||
|
#define PLAYER1 1
|
||
|
#define PLAYER2 2
|
||
|
#define BLOCKED -1
|
||
|
|
||
|
typedef struct {
|
||
|
int size;
|
||
|
int grid[9][9];
|
||
|
int player1_x, player1_y;
|
||
|
int player2_x, player2_y;
|
||
|
int current_player;
|
||
|
int winner;
|
||
|
} Game;
|
||
|
|
||
|
// Prototypes
|
||
|
void initialize_game(Game *game, int size);
|
||
|
int is_valid_move(Game *game, int x, int y);
|
||
|
void move_player(Game *game, int x, int y);
|
||
|
void block_cell(Game *game, int x, int y);
|
||
|
int has_lost(Game *game);
|
||
|
|
||
|
#endif
|