home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
UTILITIE
/
CHAOS.ZIP
/
CHAOS.C
next >
Wrap
Text File
|
1989-03-17
|
907b
|
53 lines
#include "stdio.h"
#include "graph.h"
struct POINT {
int x;
int y;
};
main()
{
struct POINT point[3];
struct POINT halfp;
long int counter;
int r_corner;
_setvideomode(_VRES16COLOR);
_setcolor(3);
point[0].x = 0;
point[0].y = 0;
point[1].x = 639;
point[1].y = 0;
point[2].x = 319;
point[2].y = 479;
for (counter=0; counter<3; counter++)
_setpixel(point[counter].x, point[counter].y);
halfp.x = rand() % 640;
halfp.y = rand() % 480;
_setpixel(halfp.x, halfp.y);
for (counter=0; counter<200000; counter++) {
r_corner = rand() % 3;
halfp.x = (halfp.x + point[r_corner].x) / 2;
halfp.y = (halfp.y + point[r_corner].y) / 2;
_setpixel(halfp.x, halfp.y);
}
getch();
_setvideomode(_DEFAULTMODE);
}