 // This function can be adapted for longer Gray codes by adding steps.uint GrayToBinary32(uint num)
// A Four-bit-at-once variant changes a binary number (abcd)2 to (abcd)2 ^ (00ab)2, then to (abcd)2 ^ (00ab)2 ^ (0abc)2 ^ (000a)2.In practice, "Gray code" almost always refers to a binary-reflected Gray code (BRGC).