Translations:Macro HilbertCurve/27/en

q = 2 while q != (2 << (self.iterations-1)): p = q - 1 for i in range(self.dimensions-1, -1, -1): if point[i] & q:                   # invert point[0] ^= p               else: # exchange gray = (point[0] ^ point[i]) & p                   point[0] ^= gray point[i] ^= gray q <<= 1
 * 1) Undo excess work