diff --git a/Makefile b/Makefile index 1d8ace3..41bce43 100644 --- a/Makefile +++ b/Makefile @@ -25,13 +25,13 @@ menu.o : taille.h menu.h #pion.o : deplacement.h obstacle.h -taille.o : taille.h +taille.o : taille.h grille.h -grille.o : taille.h +grille.o : grille.h taille.h #obstacle.o : pion.h -main.o : menu.h +main.o : menu.h grille.h # CHAPITRE 4 : DEPENDANCES AVEC COMMANDES diff --git a/grille.c b/grille.c index 80f145a..c89844a 100644 --- a/grille.c +++ b/grille.c @@ -2,8 +2,22 @@ #include "taille.h" -#include "grille.h" -int Grille(taillegrille){ + +int Grille(int taillegrille){ + int x, y; + int grille[taillegrille + 2][taillegrille + 2]; + for(x = 0; x == taillegrille + 2; x++){ + for(y = 0; y == taillegrille + 2; y++){ + grille[x][y] = 0; + if(x == 0 || x == taillegrille + 2){ + grille[x][y] = -1; + } + if(y == 0 || y == taillegrille + 2){ + grille[x][y] = -1; + } + printf("%d", grille[x][y]); + } + } return 0; } diff --git a/main.c b/main.c index 27a8a4f..2108dd8 100644 --- a/main.c +++ b/main.c @@ -4,7 +4,7 @@ #include "menu.h" -#include "taille.h" +#include "grille.h" @@ -14,7 +14,6 @@ int main (void){ EffacerEcran(CouleurParNom("white")); Menu(); while(1){ - GererChoixTaille(); } return EXIT_SUCCESS; } diff --git a/menu.c b/menu.c index e18efc8..1a1ef54 100644 --- a/menu.c +++ b/menu.c @@ -2,7 +2,7 @@ #include "taille.h" -#include "menu.h" + diff --git a/taille.c b/taille.c index d553663..7cea6d3 100644 --- a/taille.c +++ b/taille.c @@ -3,12 +3,13 @@ #include "taille.h" +#include "grille.h" /* Code permettant de choisir la taille de la grille en fonction du chiffre que l'utilisateur a entrer qui est compris entre 3 et 9 */ -int GererChoixTaille(){ +void GererChoixTaille(){ int taillegrille; if(ToucheEnAttente()){ KeySym touchPresse = Touche(); /* Prend en compte la touche presser et renvoie la touche presser */ @@ -35,5 +36,5 @@ int GererChoixTaille(){ printf("%d", taillegrille); } } - return taillegrille; + Grille(taillegrille); } diff --git a/taille.h b/taille.h index 6c82375..85fb3c5 100644 --- a/taille.h +++ b/taille.h @@ -4,6 +4,7 @@ -int GererChoixTaille(); +void GererChoixTaille(); + #endif