Creating Random Lines on the Display Screen using Computer Graphics.
Code
# include <graphics.h> # include <conio.h> # include <iostream.h> void get_driver() { int gDriver=DETECT,gMode; // define variables initgraph(&gDriver,&gMode,"c:\\tc\\bgi"); // initialize graphics Library } void main() { get_driver(); line(0,0,400,50); outtextxy(10,60,"lets see the magic"); getch(); while(!kbhit()) { setcolor(random(MAXCOLORS)); line(320,240,random(640),random(480)); delay(500); } getch(); closegraph(); }
OUTPUT
(Visited 2,277 times, 1 visits today)
Written by:
Great article, very useful !!
I enjoy the report