Gray code by nn

n=readline(p=print)
p('Gray code  n='+n)
for(i=2<<n;v=i^i/2,i++<v;)p(v.toString(2).slice(2))

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

download

return to the top page