Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # combosia.py -- maybe a new algorithm by Kirk Lawrence
- def index_to_combo(index):
- idx = index + 3
- default_combo = [0,1,2] # if index = 0
- rrr = 1
- n = rrr
- i = 3
- while 1:
- rrr += i
- if rrr > idx:
- break
- n = rrr
- i += 1
- combo = list(range(i))
- combo.pop(n-idx-1)
- return combo
- 0
- for i in range(490):
- print( index_to_combo(i) )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement