2 lines
105 B
Text
2 lines
105 B
Text
fcn grayEncode(n){ n.bitXor(n.shiftRight(1)) }
|
|
fcn grayDecode(g){ b:=g; while(g/=2){ b=b.bitXor(g) } b }
|