Gray code by Patashu

class F{static{int i=0,n=(int)(Math.random()*5)+3;for(System.out.println("Gray code  n="+n);i<1<<n;System.out.format("%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