Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,18 @@
link bitint
procedure main()
every write(right(i := 0 to 10,4),":",right(int2bit(i),10)," -> ",
right(g := gEncode(i),10)," -> ",
right(b := gDecode(g),10)," -> ",
right(bit2int(b),10))
end
procedure gEncode(b)
return int2bit(ixor(b, ishift(b,-1)))
end
procedure gDecode(g)
b := g[1]
every i := 2 to *g do b ||:= if g[i] == b[i-1] then "0" else "1"
return b
end