Affichage de la grille faite en fonction de la taille selectionner par le joueur

This commit is contained in:
ozvann
2024-11-12 23:24:16 +01:00
parent ccd6e58510
commit 666253eb3c
7 changed files with 36 additions and 19 deletions

View File

@@ -1,10 +1,8 @@
#include <stdio.h>
#include <graph.h>
#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;
}
}