SAE11_2024/blocus.h

26 lines
516 B
C
Raw Permalink Normal View History

2024-11-24 18:54:52 +01:00
#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