Gray code by pooq

p:printf;n:?read();p(?t,"Gray code  n=~d
",n);sum(p(?t,"~v,'0b
",n,?logxor(i,fix(i/2))),i,0,2^n-1);

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

download

return to the top page