Gray code by hess

a,b,n;main(){for(printf("Gray code  n=%d",a=getchar()-48);puts(""),n<1<<a;n++)for(b=a;b;)printf("%d",(n^n*2)>>b--&1);}

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

download

return to the top page