- /* PROGRAMME EN C SOUS DOS TURBO C++2 BORLAND
- ecrit le 30-06-2002 par cmarsc
- EFFETS VISUELS CIRCULAIRES MODE GRAPHIQUE */
-
- #include <graphics.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <conio.h>
- #include <time.h>
- #include <dos.h>
-
-
- int main(void) {
-
- int i,changer_de_couleur_a;
- int coul1,coul2;
-
- int gdriver = DETECT, gmode, errorcode;
-
- // initialize graphics and local variables
- initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
-
- // read result of initialization
- errorcode = graphresult();
- if (errorcode != grOk)
- {
- printf("Graphics error: %s\n", grapherrormsg(errorcode));
- printf("Press any key to halt:");
- getch();
- exit(1);
- }
-
- srand((unsigned) time(NULL));
-
- i = 0; changer_de_couleur_a = 1;
-
- do {
- i++;
- if (i > (getmaxy()/2)-5) i = 0;
-
- if ( (i % changer_de_couleur_a) == 0 ) {
- une_autre_couleur:
- // changer_de_couleur_a = rand () % (getmaxy()/2)-5;
- changer_de_couleur_a = (getmaxy()/2)-5;
-
- coul1 = rand () % 15; coul2 = rand () % 15;
-
- // eviter les couleurs identiques
- if (coul1 == coul2) goto une_autre_couleur;
-
- }
-
- // cercle progressif
- setcolor(coul2);
- circle(300, 235, i);
-
- // cercle degressif
- setcolor(coul1);
- circle(300, 235,(getmaxy()/2)-5-i);
-
- delay(16);
-
- } while (!kbhit());
-
- closegraph();
- return 0;
- }
/* PROGRAMME EN C SOUS DOS TURBO C++2 BORLAND
ecrit le 30-06-2002 par cmarsc
EFFETS VISUELS CIRCULAIRES MODE GRAPHIQUE */
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
#include <dos.h>
int main(void) {
int i,changer_de_couleur_a;
int coul1,coul2;
int gdriver = DETECT, gmode, errorcode;
// initialize graphics and local variables
initgraph(&gdriver, &gmode, "c:\\tc\\bgi");
// read result of initialization
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
srand((unsigned) time(NULL));
i = 0; changer_de_couleur_a = 1;
do {
i++;
if (i > (getmaxy()/2)-5) i = 0;
if ( (i % changer_de_couleur_a) == 0 ) {
une_autre_couleur:
// changer_de_couleur_a = rand () % (getmaxy()/2)-5;
changer_de_couleur_a = (getmaxy()/2)-5;
coul1 = rand () % 15; coul2 = rand () % 15;
// eviter les couleurs identiques
if (coul1 == coul2) goto une_autre_couleur;
}
// cercle progressif
setcolor(coul2);
circle(300, 235, i);
// cercle degressif
setcolor(coul1);
circle(300, 235,(getmaxy()/2)-5-i);
delay(16);
} while (!kbhit());
closegraph();
return 0;
}