Gray code by 51b

define(f,`Gray code  n=$1g($1,0)')define(g,`ifelse(eval(1<<$1),$2,,format(%0*d
,$1,eval($2^$2/2,2))`g($1,incr($2))')')f(include(/dev/fd/0))

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

download

return to the top page