Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -0,0 +1,18 @@
uses School;
function GrayEncode(n: longword): longword := n xor (n shr 1);
function GrayDecode(n: longword): longword;
begin
Result := 0;
while n > 0 do
begin
Result := Result xor n;
n := n shr 1;
end;
end;
begin
for var i := 0 to 31 do
Writeln($'{i,-7} {Bin(i),-7} {Bin(grayEncode(i)),-7} {grayDecode(grayEncode(i)),-7}');
end.