Ajout des fichiers makefile et main.c etc

This commit is contained in:
morinl 2022-11-29 17:30:12 +01:00
parent f89041faec
commit ae57c35317
5 changed files with 45 additions and 22 deletions

View File

@ -6,8 +6,6 @@
int main(void){ int main(void){
InitialiserGraphique(); InitialiserGraphique();
ChoisirEcran(0);
CreerFenetre(0,0,1024,576);
char tirage[50], affichage[10]; char tirage[50], affichage[10];
int pos_x, pos_y, clic_x, clic_y, im_y, im_x; int pos_x, pos_y, clic_x, clic_y, im_y, im_x;
int i, j, g; int i, j, g;

17
main.c
View File

@ -2,17 +2,22 @@
#include<stdlib.h> #include<stdlib.h>
#include<graph.h> #include<graph.h>
#include "images.h" #include "images.h"
//faire les includes des autres parties du programme #include "menu.h"
#include "main.h"
/*faire les includes des autres parties du programme*/
int main(void){ int main(void){
int test; int test=menu();
printf("Combien d'images voulez vous?(Max 20)"); printf("%d\n",test);
scanf("%d",&test); /*chargement();
chargement();
while (SourisCliquee()!=1){ while (SourisCliquee()!=1){
printf("1"); if (SourisCliquee()==1){
return EXIT_SUCCESS;
} }
printf("1");
}*/
tirage_aleatoire();
FermerGraphique(); FermerGraphique();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

6
main.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef MENU_H
#define MENU_H
int main(void);
#endif

38
menu.c
View File

@ -1,10 +1,10 @@
#include<stdlib.h> #include<stdlib.h>
#include<graph.h> #include<graph.h>
#include<stdio.h> #include<stdio.h>
#include "menu.h"
/*nombre de paire min = 4*/
//nombre de paire min = 4 int menu(void){
int main(void){
int xpos; int xpos;
int ypos; int ypos;
int i=4; int i=4;
@ -25,23 +25,31 @@ int main(void){
ChoisirCouleurDessin(c); ChoisirCouleurDessin(c);
RemplirRectangle(300,300,300,50); RemplirRectangle(300,300,300,50);
while(1){ while(1){
if(SourisCliquee()==1){
xpos=_X;
ypos=_Y;
printf("x %d y %d\n",xpos,ypos);
if((xpos<=291 && xpos<=320) && (ypos>=256 && ypos<=287)){
printf("a");
/*i++;
if (i==21){
i=4;
}
snprintf(choix,50,"%d",i); snprintf(choix,50,"%d",i);
c=CouleurParComposante(255,255,255); c=CouleurParComposante(255,255,255);
ChoisirCouleurDessin(c); ChoisirCouleurDessin(c);
RemplirRectangle(300,300,300,50); RemplirRectangle(300,300,300,50);
EcrireTexte(300,300,choix,2);*/ c=CouleurParComposante(0,0,0);
ChoisirCouleurDessin(c);
EcrireTexte(500,350,choix,2);
if(SourisCliquee()==1){
xpos=_X;
ypos=_Y;
if((xpos>=291 && xpos<=320) && (ypos>=256 && ypos<=287)){
i--;
if (i==3){
i=20;
}
}
if((xpos>=714 && xpos<=739) && (ypos>=256 && ypos<=287)){
i++;
if(i==21){
i=4;
}
}
if((xpos>=380 && xpos<=650) && (ypos>=402 && ypos<=473)){
return i;
} }
} }
} }
return 1;
} }

6
menu.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef MENU_H
#define MENU_H
int menu(void);
#endif