You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
def xlat(width, pos):
|
|
if width == 0:
|
|
return pos
|
|
|
|
x = pos % width
|
|
y = pos // width
|
|
odd = y % 2
|
|
|
|
return (y*width) + ((width-x-1)*odd) + (x*(1-odd))
|
|
|
|
for i in range(32):
|
|
print(i, xlat(8, i))
|