My latest hash up. Still not getting any pretty pictures. I much prefer this way or running the loops, seems less convoluted than before, so thank you for that.
Code:
#include <stdio.h>
int it;
double r, i;
double r2, i2;
double tmp;
double x, y, x1;
unsigned int column_max = 80;
unsigned int row_max = 54;
int col, rwo;
int main (int argc, char *argv[])
{
for(col=0; col < column_max; col++)
{
for(rwo=0; rwo < row_max; rwo++)
{
x = 1.5*((2*col/column_max) - 1); //column_max = maximum column considered
y = ((2*rwo/row_max) - 1); //row_max = row maximum considered
it = 4096;
r = i = 0; r2 = 0; i2 = 0;
do
{
tmp = r2 - i2 + x;
i = 2 * r * i * y;
r = tmp;
r2 = r*r; i2 = i * i;
} while ((r2 + i2) <= 4.0 && --it);
}
if(it == 0)
{
printf(" ");
}
else
{
printf("*");
}
if(col == 80)
{
printf("\n");
}
}
}