From 13d6c5944d08432be627c9c3c58cf3e15134032d Mon Sep 17 00:00:00 2001 From: "remi.greub" <remi.greub@hes-so.ch> Date: Tue, 25 Mar 2025 22:54:19 +0100 Subject: [PATCH] mise a jour de puissance4.h --- puissance4_GRB/puissance4.h | 39 +++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/puissance4_GRB/puissance4.h b/puissance4_GRB/puissance4.h index db8ee4e..76aea2d 100644 --- a/puissance4_GRB/puissance4.h +++ b/puissance4_GRB/puissance4.h @@ -5,12 +5,6 @@ #include <stdio.h> #include <stdbool.h> -struct grid{ - int height; - int width; - struct cell** cells; -}typedef grid; - typedef enum{ CIRCLE, //signifie le symbole du cercle CROSS, //signifie le symbole de la croix @@ -25,4 +19,37 @@ struct cell{ int j_pos; }; +struct player{ + symbol_t symbol; + int score; + int check_win; +}; + +typedef struct grid{ + int height; + int width; + int gamePlayed; + struct cell** cells; + struct player players[2]; + int curr_player; +}grid; + +struct cell **Create_grid2D(); + +void print_cells(struct cell **cell); +void print_gameCells(); + +void init_puissance4(int height, int width); + +//void Show_grid(struct cell** cell); +void cell_destroy(struct cell **cells, int height); +int kill_game(); + +int put_free_cell(int j_p, int i, symbol_t symbol); +int Launch_puissance4(); +bool Is_Grid_full(); + +symbol_t Find_winner(struct cell **grid, struct cell cellPlayed); +symbol_t CheckWin_in_a_direction(int dir[2], struct cell **grid, struct cell cell); + #endif \ No newline at end of file -- GitLab