Files
CoreWar/mars_graphic.c

48 lines
876 B
C
Raw Normal View History

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
int main(void){
couleur rouge, gris, noir;
int i, y;
int decalageligne=0, decalagecolonne=0;
InitialiserGraphique();
CreerFenetre(0, 0, LONGUEUR, HAUTEUR);
gris=CouleurParNom("gray");
rouge=CouleurParNom("red");
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;
}
couleur bleu, jaune;
int x, z;
Touche();
}