Gray code by uru

var i,j,n:word;begin
read(n);write('Gray code  n=',n);for i:=0to 1shl n-1do
for j:=0to n-1do
write(^j:1shr j,(i*2xor i)shr(n-j)and 1)end.

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

download

return to the top page