Skip to main content
added 4 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion and with Todd Lehman's improvements, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char green_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char blue_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256&&k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return 128-k/2;200;
}

gives

enter image description hereenter image description here

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion and with Todd Lehman's improvements, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char green_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char blue_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return 128-k/2;
}

gives

enter image description here

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion and with Todd Lehman's improvements, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char green_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char blue_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return 128-k/200;
}

gives

enter image description here

added 13 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion and with Todd Lehman's improvements, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0;int k;fory=0,k=0,X,Y;while(k=0;k++<255;k++<256e2&&(X=x*x){float a=x*x-y*y++(i-14680.0Y=y*y)/102400;y=2*x*y+<4)y=2*x*y+(j-89500.0)/102400;x=a;if102400.,x=X-Y+(x*x+y*y>4i-14680)break;}return/102400.;return k;log(k)/10.15*256;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;fory=0,k=0,X,Y;while(k=0;k++<255;k++<256e2&&(X=x*x){float a=x*x-y*y++(i-14680.0Y=y*y)/102400;y=2*x*y+<4)y=2*x*y+(j-89500.0)/102400;x=a;if102400.,x=X-Y+(x*x+y*y>4i-14680)break;}return/102400.;return k;log(k)/10.15*256;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;fory=0,k=0,X,Y;while(k=0;k++<255;k++<256&&(X=x*x){float a=x*x-y*y++(i-14680.0Y=y*y)/102400;y=2*x*y+<4)y=2*x*y+(j-89500.0)/102400;x=a;if102400.,x=X-Y+(x*x+y*y>4i-14680)break;}return/102400.;return 128-k/2;
}

gives

enter image description hereenter image description here

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return k;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return k;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return 128-k/2;
}

gives

enter image description here

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion and with Todd Lehman's improvements, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char green_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256e2&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return log(k)/10.15*256;
}
char blue_fn(int i,int j){
    float x=0,y=0,k=0,X,Y;while(k++<256&&(X=x*x)+(Y=y*y)<4)y=2*x*y+(j-89500)/102400.,x=X-Y+(i-14680)/102400.;return 128-k/2;
}

gives

enter image description here

added 733 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return k;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return k;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return 128-k/2;
}

gives

enter image description here

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

Of course, there has to be a Mandelbrot submission.

enter image description here

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>31?256:k*8;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k>63?256:k*4;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<256;){float a=x*x-y*y+(i-768.0)/512;y=2*x*y+(j-512.0)/512;x=a;if(x*x+y*y>4)break;}return k;
}

Trying to improve the colour scheme now. Is it cheating if I define the computation as a macro is red_fn and use that macro in the other two so I have more characters for fancy colour selection in green and blue?

Edit: It's really hard to come up with decent colour schemes with these few remaining bytes. Here is one other version:

/* RED   */ return log(k)*47;
/* GREEN */ return log(k)*47;
/* BLUE  */ return 128-log(k)*23;

enter image description here

And as per githubphagocyte's suggestion, we can easily pick smaller sections:

E.g.

char red_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return k;
}
char green_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return k;
}
char blue_fn(int i,int j){
    float x=0,y=0;int k;for(k=0;k++<255;){float a=x*x-y*y+(i-14680.0)/102400;y=2*x*y+(j-89500.0)/102400;x=a;if(x*x+y*y>4)break;}return 128-k/2;
}

gives

enter image description here

added 321 characters in body
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975
Loading
Source Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975
Loading