Gray code by pooq

m:-readln([N]),format("Gray code  n=~d
",N),A is 2^N-1,between(0,A,X),\+format("~`0t~2r~*+
",[X xor(X//2),N]).

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

download

return to the top page