home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
WGT_TC21.ZIP
/
WGT04.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-07-17
|
1KB
|
61 lines
#include <conio.h>
#include "c:\tc\wgt\wgt.h"
/* WORDUP Graphics Toolkit Version 2.1
Demonstration program 4
This program has several loops which perform a drawing action
until you press a key.
Loops include line,rectangle,bar,circle and filled circle
*/
int x,y,col;
void main(void)
{
vga256(); // initializes system
do {
x=rand() % 320;
y=rand() % 200;
col=rand() % 255;
wsetcolor(col);
wline(rand() % 320,rand() % 200,x,y); // draw randomly
} while (kbhit()==0);
getch(); // get the key
wcls(0);
do {
x=rand() % 320;
y=rand() % 200;
col=rand() % 255;
wsetcolor(col);
wrectangle(rand() % 320,rand() % 200,x,y);
} while (kbhit()==0);
getch(); // get the key
wcls(0);
do {
x=rand() % 320;
y=rand() % 200;
col=rand() % 255;
wsetcolor(col);
wbar(rand() % 320,rand() % 200,x,y);
} while (kbhit()==0);
getch(); // get the key
wcls(0);
do {
x=rand() % 320;
y=rand() % 200;
col=rand() % 255;
wsetcolor(col);
wcircle(x,y,rand() % 100);
} while (kbhit()==0);
getch();
wcls(0);
do {
x=rand() % 320;
y=rand() % 200;
col=rand() % 255;
wsetcolor(col);
wfill_circle(x,y,rand() % 100);
} while (kbhit()==0);
getch(); // get the key
textmode(C80); // used to return to text mode
}