enum G{G;int i,n=(int)(8*Math.random());{for(;i<1<<n;)System.out.printf((i<1?"Gray code n="+n+"\n%0":"%0")+n+"d\n",Long.decode(Long.toString(i^i++/2,2)));}}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page