Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # loop-de-loop.py -- loop-de-loop-de-loop... bork-bork-bork!
- def loop(v,i):
- if v:
- try:
- x,y,z = v[i]
- except:
- z = 1
- x,y = v[i]
- xx = x + z
- if (x > y and xx <= y) or (x < y and y <= xx):
- v.pop(i)
- else:
- v[i] = xx, y, z
- 0
- loops = [(400,-50,-50),(0,100,20),(0,-500,-50),(25,0,-3),(0,10)]
- while loops:
- print [z[0] for z in loops[:3]]
- for r in range(min(2,len(loops)-1),-1,-1):
- loop(loops,r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement