From 43cd86612ff564021e73a01b3b8435f64811db4c Mon Sep 17 00:00:00 2001 From: orfao Date: Fri, 1 Dec 2023 15:59:01 +0100 Subject: [PATCH] maj --- src/grille.c | 33 +++++++++++++++++++++++++++++++++ src/snake.c | 7 +++++++ 2 files changed, 40 insertions(+) create mode 100644 src/grille.c create mode 100644 src/snake.c diff --git a/src/grille.c b/src/grille.c new file mode 100644 index 0000000..be62b7b --- /dev/null +++ b/src/grille.c @@ -0,0 +1,33 @@ +#include +#include +#include + +int* creer_grille(void){ + int* Grille=NULL; + Grille=(int*) malloc(40*60*sizeof(int)); + return Grille; +} + +void creer_grille_graph(){ + int x_grille=0,y_grille=0,x,y; + ChoisirCouleurDessin(CouleurParComposante(0,0,0)); + DessinerRectangle(x_grille,y_grille,1200,1000); + DessinerRectangle(x_grille,y_grille,900,600); + for(x=x_grille;x<1100;x=x+15){ + DessinerSegment(x,y_grille,x,800); + } + for(y=y_grille;y<800;y=y+15){ + DessinerSegment(x_grille,y,1100,y); + } + +} + +int main(void){ + char x; + InitialiserGraphique(); + CreerFenetre(0,0,1300,1300); + creer_grille_graph(); + while(x != 'q'){ + scanf("%c",&x); + } +} \ No newline at end of file diff --git a/src/snake.c b/src/snake.c new file mode 100644 index 0000000..13c1539 --- /dev/null +++ b/src/snake.c @@ -0,0 +1,7 @@ +#include +#include +#include + +void creer_snake(){ + serpent[1] +} \ No newline at end of file