Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # base_sorted_index.py -- important: for a seemingly unique AI project in mind
- maximum = 4095
- def base12(n, b=1,length=12):
- b += 1
- if n == 0:
- return [0]*length
- values = []
- for z in 'z'*length:
- r = n % b
- n = int(n/b)
- values.append(r)
- return values[::-1]
- 0
- ttt = []
- i = 0
- while 1:
- t = base12(i)
- ttt += [t]
- if t == [1]*12:
- break
- i += 1
- 0
- pos = ttt[:]
- ttt.sort(key=sum)
- for t in ttt:
- print(''.join([str(i) for i in t]), sum(t), pos.index(t))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement