2021-12-17 18:47:33 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <graph.h>
|
|
|
|
|
|
|
|
#define LONGUEUR 1000
|
|
|
|
#define HAUTEUR 1000
|
|
|
|
|
|
|
|
#define NBRLIGNES 89
|
|
|
|
#define NBRCOLONNES 89
|
2021-12-17 19:16:39 +01:00
|
|
|
|
|
|
|
void dessiner_case(int colonne, int ligne, int numerovirus){
|
|
|
|
|
|
|
|
/* le numerovirus est là pour choisir la couleur à dessiner */
|
|
|
|
|
|
|
|
couleur rouge, bleu;
|
|
|
|
|
|
|
|
if(numerovirus==1){
|
|
|
|
rouge=CouleurParNom("red");
|
|
|
|
ChoisirCouleurDessin(rouge);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(numerovirus==2){
|
|
|
|
bleu=CouleurParNom("blue");
|
|
|
|
ChoisirCouleurDessin(bleu);
|
|
|
|
}
|
|
|
|
|
|
|
|
RemplirRectangle(colonne*10+1,ligne*10+1,9,9);
|
|
|
|
|
|
|
|
}
|
|
|
|
void print_grille(void){
|
|
|
|
couleur gris, noir;
|
2021-12-17 18:47:33 +01:00
|
|
|
|
|
|
|
int i, y;
|
|
|
|
|
|
|
|
int decalageligne=0, decalagecolonne=0;
|
|
|
|
|
|
|
|
InitialiserGraphique();
|
|
|
|
|
|
|
|
CreerFenetre(0, 0, LONGUEUR, HAUTEUR);
|
|
|
|
|
|
|
|
gris=CouleurParNom("gray");
|
|
|
|
noir=CouleurParNom("black");
|
|
|
|
ChoisirCouleurDessin(gris);
|
|
|
|
|
|
|
|
EffacerEcran(gris);
|
|
|
|
|
|
|
|
ChoisirCouleurDessin(noir);
|
|
|
|
|
|
|
|
printf("%d\n", (LONGUEUR/(NBRCOLONNES*NBRLIGNES)));
|
|
|
|
|
|
|
|
for (i=0; i<NBRLIGNES; i++){
|
|
|
|
for (y=0; y<NBRCOLONNES; y++){
|
|
|
|
DessinerRectangle(decalagecolonne,decalageligne,10, 10);
|
|
|
|
decalagecolonne=decalagecolonne+10;
|
|
|
|
}
|
|
|
|
decalageligne=decalageligne+10;
|
|
|
|
decalagecolonne=0;
|
2021-12-17 19:16:39 +01:00
|
|
|
}
|
|
|
|
for (y=0; y<79; y++){
|
|
|
|
DessinerRectangle(decalagecolonne,decalageligne,10, 10);
|
|
|
|
decalagecolonne=decalagecolonne+10;
|
|
|
|
}
|
2021-12-17 18:47:33 +01:00
|
|
|
|
|
|
|
|
2021-12-17 19:16:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(void){
|
|
|
|
|
|
|
|
print_grille();
|
|
|
|
|
|
|
|
dessiner_case(50,10,2);
|
2021-12-17 18:47:33 +01:00
|
|
|
|
|
|
|
Touche();
|
2021-12-17 19:16:39 +01:00
|
|
|
FermerGraphique();
|
2021-12-17 18:47:33 +01:00
|
|
|
}
|