Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from itertools import cycle, islice
- def increasing_cyclical(xs, period, max_width):
- while True:
- for x in range(period):
- g = list(islice(cycle(xs), period+x))[x:]
- for y in range(max_width):
- yield list(islice(iter(g), y+1))
- def increasing_cyclical(xs, period, max_width):
- for x in range(period):
- g = list(islice(cycle(xs), period+x))[x:]
- for y in range(max_width):
- yield list(islice(iter(g), y+1))
Add Comment
Please, Sign In to add comment