Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Puissance4_Greub_Remi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
remi.greub
Puissance4_Greub_Remi
Commits
13d6c594
Commit
13d6c594
authored
1 month ago
by
remi.greub
Browse files
Options
Downloads
Patches
Plain Diff
mise a jour de puissance4.h
parent
10a8ae39
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
puissance4_GRB/puissance4.h
+33
-6
33 additions, 6 deletions
puissance4_GRB/puissance4.h
with
33 additions
and
6 deletions
puissance4_GRB/puissance4.h
+
33
−
6
View file @
13d6c594
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment