Code: Select all

`max = 16`

g = []

a = 0

b = size - 1

for x in range(max/2):

if a % 2 == 0:

g.append(b)

g.append(a)

else:

g.append(a)

g.append(b)

a += 1

b -= 1

print g

which produces

Code: Select all

`[15, 0, 1, 14, 13, 2, 3, 12, 11, 4, 5, 10, 9, 6, 7, 8]`

I was wondering if anyone has a simpler, more elegant method of doing such a thing. Also max will always be even so don't worry about odd cases.