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
fd39e9d0
Commit
fd39e9d0
authored
1 month ago
by
remi.greub
Browse files
Options
Downloads
Patches
Plain Diff
bug, redemande une case si la colonne est pleine (sans que la grille le sois pour autant)
parent
b3b52cb9
No related branches found
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.c
+6
-4
6 additions, 4 deletions
puissance4_GRB/puissance4.c
with
6 additions
and
4 deletions
puissance4_GRB/puissance4.c
+
6
−
4
View file @
fd39e9d0
...
...
@@ -98,7 +98,6 @@ int is_cell_free(int j_p, int i, symbol_t symbol){
return
-
1
;
}
}
return
i
;
}
int
Launch_puissance4
(){
...
...
@@ -115,12 +114,12 @@ int Launch_puissance4(){
if
(
chiffre
>=
game
.
width
||
chiffre
<
0
){
printf
(
"HEP HEPHEP !! donne un chiffre dans la plage donnee manche a couille
\n
"
);
}
}
while
(
chiffre
>=
game
.
width
||
chiffre
<
0
);
}
while
(
(
chiffre
>=
game
.
width
)
||
(
chiffre
<
0
)
||
is_cell_free
(
chiffre
,
0
,
game
.
players
[
game
.
curr_player
].
symbol
)
<
0
)
;
game
.
gamePlayed
-=
1
;
//peut être le mettre plus bas non ?
int
i
=
0
;
//verifier que put free cell fonctionne
if
((
i
=
put_free_cell
(
chiffre
,
0
,
game
.
players
[
game
.
curr_player
].
symbol
))
<
0
){
if
((
i
=
put_free_cell
(
chiffre
,
game
.
players
[
game
.
curr_player
].
symbol
))
<
0
){
//la grille est pleine genre... ou y a un bug de zinzin
if
(
Is_Grid_full
()){
//la grille est pleine sa mere la pute
...
...
@@ -142,6 +141,7 @@ int Launch_puissance4(){
if
(
winner
!=
EMPTY
){
if
(
winner
==
CROSS
){
//reset du jeu + mise a jour des scores (scores optionels)
print_gameCells
();
printf
(
"la croix a gagnée cette connasse
\n
"
);
//print joueur croix a gagné
//fin du jeu
...
...
@@ -150,6 +150,7 @@ int Launch_puissance4(){
if
(
winner
==
CIRCLE
){
//reset du jeu + mise a jour des scores (scores optionels)
//print joueur cercle a gagné
print_gameCells
();
printf
(
"le cercle a gagné cet enorme zgeg
\n
"
);
//fin du jeu
return
CIRCLE
;
...
...
@@ -158,7 +159,8 @@ int Launch_puissance4(){
//sois le jeu est plein, sois y a juste pas encore de winner
if
(
Is_Grid_full
()){
//la grille est pleine
//print egalite
//print egalite + la fin de la grille
print_gameCells
();
printf
(
"y a un egalite dans les regles de l'art mash'allah
\n
"
);
//winner = EQUAL;
//fin du jeu
...
...
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