func morton(x, y, z uint32) uint32 { const ( shift1 = 12 mask1 = 0b_0000_0000_0111_1100_0000_0000_0011_1111 ) z = (z<<shift1 + z) & mask1 y = (y<<shift1 + y) & mask1 x = (x<<shift1 + x) & mask1 const ( shift2 = 6 mask2 = 0b_0001_1000_0001_1100_0000_1110_0000_0111 ) z = (z<<shift2 + z) & mask2 y = (y<<shift2 + y) & mask2 x = (x<<shift2 + x) & mask2 const ( shift3 = 3 mask3 = 0b_0001_1001_0000_1100_1000_0110_0100_0011 ) z = (z<<shift3 + z) & mask3 y = (y<<shift3 + y) & mask3 x = (x<<shift3 + x) & mask3 const ( shift4 = 2 mask4 = 0b_0100_1001_0010_0100_1001_0010_0100_1001 ) z = (z<<shift4 + z) & mask4 y = (y<<shift4 + y) & mask4 x = (x<<shift4 + x) & mask4 return z<<2 + y<<1 + x }
To receive a hint, submit unfixed code.