diff --git a/Makefile b/Makefile index e7225b8..5ca0ede 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ CFLAGS = -Wall -ansi -pedantic #deplacement.o : pion.h obstacle.h -menu.o : taille.h menu.h nbjoueur.h nbjoueur2.h boutonJVJ.h +menu.o : taille.h menu.h nbjoueur.h nbjoueur2.h boutonJVJ.h grille.h #pion.o : deplacement.h obstacle.h @@ -37,11 +37,11 @@ boutonJVJ.o : boutonJVJ.h nbjoueur2.o : nbjoueur2.h -grille.o : grille.h taille.h +grille.o : grille.h #obstacle.o : pion.h -jeu.o : jeu.h +jeu.o : jeu.h grille.h main.o : menu.h jeu.h diff --git a/game b/game index 73c1ce6..85a213b 100755 Binary files a/game and b/game differ diff --git a/grille.c b/grille.c index f78db24..a9509f3 100644 --- a/grille.c +++ b/grille.c @@ -1,10 +1,8 @@ #include +#include - -#include "taille.h" - - -void Grille(int taillegrille){ +/* +void Test(){ int x, y; int tabgrille[taillegrille + 2][taillegrille + 2]; for(x = 0; x < taillegrille + 2; x++){ @@ -21,3 +19,29 @@ void Grille(int taillegrille){ printf("\n"); } } +*/ + +void Grille(int taille){ + int bord = 0, x = 100, xx = 0, y = 100, yy = 100; + ChoisirCouleurDessin(CouleurParNom("Black")); + for(bord = 0; bord < taille; bord++){ + DessinerSegment(50, 100, x, 100); + x += 50; + } + x -= 50; + for(bord = 0; bord <= taille; bord++){ + DessinerSegment(50, 100, 50 , y); + DessinerSegment(x, 100, x, y); + y += 50; + } + y -= 50; + DessinerSegment(50, y, x, y); + for(bord = 0; bord <= taille; bord++){ + DessinerSegment(50, yy, x, yy); + yy += 50; + } + for(bord = 0; bord <= taille; bord++){ + DessinerSegment(xx, 100, xx, y); + xx += 50; + } +} diff --git a/grille.h b/grille.h index 46dcb66..c5fd477 100644 --- a/grille.h +++ b/grille.h @@ -3,7 +3,7 @@ -void Grille(int taillegrille); +void Grille(int taille); #endif diff --git a/jeu.c b/jeu.c index 90fad60..713c616 100644 --- a/jeu.c +++ b/jeu.c @@ -6,10 +6,6 @@ void GraphJeu(){ - int x = 50, y = 50, xx = 150, yy = 50, i = 0; printf("fichier jeu.c taille variable\n"); - for(i = 1; i < 9; i++){ - DessinerSegment(x, y * i, xx * i, yy * i); - } while(1){} } diff --git a/menu.c b/menu.c index a77a11e..ada00af 100644 --- a/menu.c +++ b/menu.c @@ -5,7 +5,7 @@ #include "nbjoueur.h" #include "nbjoueur2.h" #include "boutonJVJ.h" -#include "jeu.h" +#include "grille.h" int Menu() { @@ -40,7 +40,7 @@ int Menu() { printf("choix de menu %d\n", choix); FermerGraphique(); InitialiserGraphique(); - /* Demander a Luck quel est la taille de fenetre max qu'il peut voir sur son écran pour corriger les SAE */ - CreerFenetre(50, 50, 600, 600); + CreerFenetre(50, 50, 650, 650); + Grille(echotaille); return choix; } diff --git a/taille.c b/taille.c index 0ced844..af4baf0 100644 --- a/taille.c +++ b/taille.c @@ -2,8 +2,6 @@ #include -#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 */ @@ -34,7 +32,6 @@ int GererChoixTaille(){ } if(taille != 0){ printf("Taille de taille.c = %d\n", taille); - Grille(taille); return taille; } }