#include <stdio.h>
#include <math.h>
int main (void ){
double x,y,z,xi, xd,yi,yd;int o,i;
xi =3.0/80; yi =3.0/28; int px[80]; for (i=0;
i < 80; i++) px[i]=0; yd = -1.5;for(y = -1.5;
y < 1.5;y+=0.001) {o = 0; i = 0; xd =-1.5;for
(x=-1.5;x<1.5;x+=0.00001) {z=x*x+y*y-1;o|=(
fabs(z*z*z+x*x*y*y*y) < .000002); if(x-
xd > xi){ if (o) px[i++] |= 1; else
px[i++] |= 0; o = 0;xd += xi;}}
if (y - yd > yi){ for (i=0;
i<80;i++){putchar(px[i]
?'x':' '); px[i]=0;
}putchar('\n');
yd += yi;
} }
}
It's a heart-shaped C program that prints a heart. I did this in about 15 minutes, so it's not particularly clever obfuscation or particularly good code; it's just a quick-n-dirty implicit curve plotting function that's been...reshaped. I think you could get rid of the two lines at the top, but it's tricky because it's hard to make
int putchar(int);double fabs(double); fit into the heart shape.Here is the output:
xxxxxxx xxxxxxx xxxxxxx xxxxxxx
xxxx xxxxxx xxxxxx xxxx
xxx xxxx xxx
xx xx
xx xx
xx xx
x x
x x
xx xx
xx xx
xx xx
xx xx
xx xx
xxx xxx
xxx xxx
xxxx xxxx
xxxx xxxx
xxxx xxxx
xxxxx xxxxx
xxxxxx xxxxxx
xxxxxxxx
xx

1 comments:
you should make a heart shaped quine.
Post a Comment