Gray code by 51b

for(n=readline(i=-2);++i<1<<n;)print(~i?(i^i/2|1<<n).toString(2).slice(1):"Gray code  n="+n)

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

download

return to the top page