#AWK and friends. ##Look mom! I've shaken the colors away!
AWK and friends.
Look mom! I've shaken the colors away!
The 'x' file:
BEGIN {
N=5
C=2^N
print "P3\n"2^(3*N-int(3*N/2))" "2^int(3*N/2)"\n"C-1
for(x=0;x<C;x++)
for(y=0;y<C;y++)
for(z=0;z<C;z++)
print x^4+y^4+z^4"\t"x" "y" "z | "sort -n | cut -f2-"
}
Run:
awk -f x > x.ppm
Output:
N=5:

N=6:
