hallo
ich wollte fragen ob ihr mir vielleicht sagen könnt wie ich das folgenden programm erstellen kann.
(aus einem buch)
/* one.cpp Grafik - Demo unter DOS, 16 Bit */
# include <graphics.h>
# include <stdlib.h>
# include <stdio.h>
# include <conio.h>
# include <dos.h>
# define pixelcount 30000
int main ( )
{ int gdriver = DETECT;
int gmode, errorcode;
int i, x, y, color, maxx, maxy, maxcolor, seed;
initgraph (&gdriver, &gmode, "C:"); // hier richtigen Pfad einstellen !!!
errorcode = graphresult ();
if (errorcode != grOk)
{ printf ("Grafikfehler: %s\n", grapherrormsg (errorcode));
printf ("Taste drücken: ");
getch ( );
exit (1);
} ;
maxx = getmaxx ( ) + 1;
maxy = getmaxy ( ) + 1;
maxcolor = getmaxcolor ( ) + 1;
while ( ! kbhit ( ) )
{ seed = random (32767);
srand (seed); // Initialisierung des Zufallsgenerators
for ( i = 0; i < pixelcount; i ++ )
{ x = random (maxx);
y = random (maxy);
color = random (maxcolor);
putpixel (x, y, color);
} ;
srand (seed);
for (i = 0; i < pixelcount; i ++ )
{ x = random (maxx);
y = random (maxy);
color = random (maxcolor);
if (color == getpixel (x, y) ) putpixel (x, y, 0);
}
} ;
getch ( );
closegraph ( );
return 0;
}
im buch steht, dass man es unter DOS compiliren muss und dass man die BGI Bibliothek braucht. jetzt weis ich nicht wie ich das mit der BGI mache, bzw mit welchem compiler ich am besten arbeite. bis jetzt hatte ich immer den Dev-C++.
ich wollte fragen ob ihr mir vielleicht sagen könnt wie ich das folgenden programm erstellen kann.
(aus einem buch)
/* one.cpp Grafik - Demo unter DOS, 16 Bit */
# include <graphics.h>
# include <stdlib.h>
# include <stdio.h>
# include <conio.h>
# include <dos.h>
# define pixelcount 30000
int main ( )
{ int gdriver = DETECT;
int gmode, errorcode;
int i, x, y, color, maxx, maxy, maxcolor, seed;
initgraph (&gdriver, &gmode, "C:"); // hier richtigen Pfad einstellen !!!
errorcode = graphresult ();
if (errorcode != grOk)
{ printf ("Grafikfehler: %s\n", grapherrormsg (errorcode));
printf ("Taste drücken: ");
getch ( );
exit (1);
} ;
maxx = getmaxx ( ) + 1;
maxy = getmaxy ( ) + 1;
maxcolor = getmaxcolor ( ) + 1;
while ( ! kbhit ( ) )
{ seed = random (32767);
srand (seed); // Initialisierung des Zufallsgenerators
for ( i = 0; i < pixelcount; i ++ )
{ x = random (maxx);
y = random (maxy);
color = random (maxcolor);
putpixel (x, y, color);
} ;
srand (seed);
for (i = 0; i < pixelcount; i ++ )
{ x = random (maxx);
y = random (maxy);
color = random (maxcolor);
if (color == getpixel (x, y) ) putpixel (x, y, 0);
}
} ;
getch ( );
closegraph ( );
return 0;
}
im buch steht, dass man es unter DOS compiliren muss und dass man die BGI Bibliothek braucht. jetzt weis ich nicht wie ich das mit der BGI mache, bzw mit welchem compiler ich am besten arbeite. bis jetzt hatte ich immer den Dev-C++.