wallart/xlat.py

13 lines
220 B
Python
Raw Normal View History

2023-01-06 12:50:46 -07:00
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))