# Category : Science and Education

Archive : CHAOS.ZIP

Filename : CHAOS3.C

#include "math.h"

#include "graph.h"

struct POINT {

int x;

int y;

};

main()

{

struct POINT point[20];

struct POINT halfp;

long int counter;

int r_corner;

int num;

double points;

double pie = 3.141593;

double c;

int i = 0;

system("CLS");

printf("Enter the number of points to define the object: ");

if (scanf("%d", &num) == 0)

exit();

points = (double) num;

_setvideomode(_VRES16COLOR);

_setcolor(4);

for (c = 0; c < (pie * 2.0); c += (pie * 2.0) / points) {

point[i].x = (int) (320.0 + (sin(c) * 220.0));

point[i].y = (int) (240.0 + (cos(c) * 220.0));

i++;

}

for (counter=0; counter<3; counter++)

_setpixel(point[counter].x, point[counter].y);

#if FALSE

halfp.x = rand() % 640;

halfp.y = rand() % 480;

#endif

halfp.x = 320;

halfp.y = 240;

_setpixel(halfp.x, halfp.y);

for (counter=0; counter<200000; counter++) {

r_corner = rand() % num;

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);

}

Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/