```
Now you can discover new interesting fractals yourself!

Without having to know anything about complex numbers or
dynamical systems. The trick is the program which follows.

Just run it and every time it will generate a new fractal-like
image.

In fact it generates random iterative formulas producing
an image that represents the julia set of the formula.

To wet your appetite I have posted  two such images in
alt.binaries.pictures.fractals. You can reproduce the
image called "Garden" with the following data:
static int nsel[2] = { 9, 4};
static int isel [2] [50] = {
{  14, 20,  9,  3, 16, 22, 19, 13, 16},
{  13, 19,  8, 20}};
static float c [2] [50] = {
{ -0.3890768, 0.9319068, 0.5816987,-0.8370411,
-0.6843160, 0.2449834, 0.6121157,-0.6030725,
-0.2089733},
{  0.9906156,-0.0906956, 0.1155193,-0.2545933
}};
And the second called "Ant" with the data:
static int nsel[2] = { 5,30};
static int isel [2] [50] = {
{  14,  5,  2, 16, 21},
{  14, 11,  9,  8,  3, 14,  9,  8,  8,  8,
18,  7, 18,  6, 22, 13, 22, 18,  6, 10,
1, 12, 20,  4,  1, 10,  9, 22, 22, 16
}};
static float c [2] [50] = {
{  0.2518281,-0.3296531, 0.5021137, 0.8013867,
0.9232459},
{  0.4548206, 0.6028448, 0.2868689,-0.5640269,
0.3280247, 0.8860395, 0.5030885,-0.5097839,
-0.8538470, 0.5237761,-0.9086919,-0.4687982,
0.7613782,-0.2227489, 0.9734645,-0.9133334,
-0.3199611,-0.9586719, 0.3643311,-0.9964381,
-0.6912493, 0.9343832, 0.4551306, 0.4753968,
0.0754888,-0.7368609, 0.9721158, 0.9445785,
-0.5743186, 0.8625289}};

These images where discovered by running the program many,
many times until I got these and other interesting images.

In principle any possible fractal image can be generated.
For example the julia set of the x=x^2+c formula would
correspond to data like this:
int nsel[2] = { 6, 4};
int isel[2][50] = { { 14, 8, 16, 7, 20, 3},
{ 14, 7, 9, 3}};
int c[2][50] = {{0.,0.,0.,0.,0.,.53},
{0.,0.,2.,.32}};

There are many tricks that you can apply to speed up the
discovery process. One is that of filtering uninteresting
images (like those have all pixels identical) by computing
the inner loop for a few random pixels and discarding the
formula if a large percentage of these pixels come out
as being equal.

If you want to know more about this method of
discovering new fractals, send me a mail and
I'll send you the preprint of my paper:
"Drawing by accident" where this method is described
in more detail.

The paper has 7 color figures. Let me know which format
you prefer for the text: ascii,dvi,postscript; and for
the pictures :gif,eps,or other formats.
Send your mail to:
zito@dxcern.cern.ch (Unix)
zito@cernvm.cern.ch (Bitnet)
zito@vxcern.cern.ch zito@bari.infn.it (Decnet)

Here starts the program
---------Cut here ------------------------------
/*                                            */
/*   Program ufmac to generate random         */
/*    iterative formulas and to compute       */
/*    their Julia set                         */
/*                                            */
#include
#include

main(argc,argv) unsigned int argc; char *argv[]; {
int Xscreen = 200,Yscreen=200;
float Left= -4.,Right= 4.,Bottom= -4.,Top= 4.;
int numcol = 256;
int maxiter = 255;
float x,y,x0,y0,xd,yd,Deltax,Deltay;
int i,j,ib,iter,ic,l,j1;
float stack[50];
int istack,k,numpull;
int iexe[2][50];
float p[2],p0[2];
/* nsel,isel and c contain the randomly generated formula*/
int nsel[2],isel[2][50];
float c[2][50];

/* Generate here random formula */

/* rndm() should return a random*/
/* float in the range 0-1 always*/
/* different every time the */
/* program is started */
for(i=0; i < 2; i++) {
nsel[i] = (int) (rndm()*49.+2.);
for(j=0; j < nsel[i]; j++) {
isel [i] [j] = (int) (rndm()*22. + 1.);
c [i] [j] = rndm()*2. -1.;
}
}

/*Force first command to be a set accumulator */
/* command; not necessary but will speed up  */
/* formula computation                       */
for(i=0; i < 2; i++) {
isel [i] [0] = (int)(rndm()*3. + 13.);
}

/* This is to speed up formula computation */
/* The accumulator value is pushed in the stack only  */
/* if there is a subsequent command that uses the stack */
/* iexe[i][j]=0 means that the command isel [i][j] must */
/* be ignored.                                          */
for(i=0; i < 2; i++)
for(j=0; j < nsel[i]; j++) iexe[i][j] = 1;
for (j=0; j < 2; j++) {
for (i=0; i < nsel[j]; i++) {
if(isel[j][i] > 15 && isel[j][i] < 19) {
numpull = 0;
if((i+1) < nsel[j]) {
for(k = i+1; k < nsel[j]; k++) {
if(isel[j][k] > 15 && isel[j][k] < 19)
numpull = numpull - 1;
if(isel[j][k] > 18 && isel[j][k] < 23)
numpull = numpull + 1;
if(numpull == 1) break;
}
}
if(numpull != 1) iexe[j][i] = 0;
}
}
}

/* Initialize here graphics */
/* Left,Right,Bottom,Top define the world coordinates,
Xscreen,Yscreen the number of X and Y pixel */

/* Main loop to compute Julia set */
Deltax = (Right - Left) / Xscreen;
Deltay = (Top - Bottom) / Yscreen;
for (j=0; j < Yscreen; j++) {
for (l=0;l < Xscreen; l++) {
x0 = (l-1)*Deltax + Left;
y0 = (j-1)*Deltay + Bottom;
x = x0 ;
y = y0;
iter = 1;
while(iter <= maxiter){

/* Iteration starts here */
p0[0] = x0;
p0[1] = y0;
for(i=0; i< 2; i++) {
istack = 0;
p[i] = p0[i];
for (k=0; k < nsel[i]; k++) {
switch (isel[i][k]) {
case  1: p[i] = p[i] + x0;break;
case  2: p[i] = p[i] + y0;break;
case  3: p[i] = p[i] + c[i][k];break;
case  4: p[i] = p[i] - x0;break;
case  5: p[i] = p[i] - y0;break;
case  6: p[i] = p[i] - c[i][k];break;
case  7: p[i] = p[i] * x0;break;
case  8: p[i] = p[i] * y0;break;
case  9: p[i] = p[i] * c[i][k];break;
case 10: p[i] = p[i] / x0;break;
case 11: p[i] = p[i] / y0;break;
case 12: p[i] = p[i] /c[i][k];break;
case 13: if(k == 0)p[i] = x0;break;
case 14: if(k == 0)p[i] = y0;break;
case 15: if(k == 0)p[i] = c[i][k];break;
case 16: if(iexe[i][k] == 1){
istack = istack + 1; stack[istack] = p[i];
p[i] = x0; }break;
case 17: if(iexe[i][k] == 1){
istack = istack + 1; stack[istack] = p[i];
p[i] = y0; }break;
case 18: if(iexe[i][k] == 1){
istack = istack + 1; stack[istack] = p[i];
p[i] = c[i][k]; }break;
case 19: if(istack > 0) {p[i] = p[i] + stack[istack];
istack = istack - 1;}break;
case 20: if(istack > 0) {p[i] = p[i] - stack[istack];
istack = istack - 1;}break;
case 21: if(istack > 0) {p[i] = p[i] * stack[istack];
istack = istack - 1;}break;
case 22: if(istack > 0) {
p[i] = p[i] / stack[istack];
istack = istack - 1;}break;
}
}
}
x = p[0];
y = p[1];
/* end of iteration */

if(fabs((double)x) < 1.e-10)x = 0.;
if(fabs((double)y) < 1.e-10)y = 0.;
if(fabs((double)x) > 1.e5 || fabs((double)y) > 1.e5)break;
iter = iter + 1;
x0 = x;
y0 = y;
}
ic = (iter % numcol) + 1;
/*  Here set pixel l,j with color ic   */
setc(&l,&j,&ic);
}
}
}

----------- Cut here -----------------------------
```