Gray code by kinaba

b,g,c;main(n){for(gets(&n);b<1<<n;c=-b&b)printf("Gray code  n=%1$d\n%0*o"+!!b++*17,n&=7,g^=c*c*c);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page