Gray code by 51b

: a { n } n 0 .r 2 base ! 1 n lshift 0 do cr i i 2/ xor 0 <# #s #> n over - zeros type loop ;
." Gray code  n="key 48 - a

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

download

return to the top page