Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Weak_Random_pattern_test.py
- seed = 2
- counter = 0
- def Weak_Random(vmin=0, vmax=100):
- global counter, seed
- seed = str(vmax//2)+str(seed)+'1'
- vmax -= vmin
- while True:
- counter += 1
- combo = (counter^counter*int(str(counter)+seed))%vmax+vmin
- yield combo
- gen = Weak_Random(vmin=0, vmax=9)
- test = []
- ttt = [[next(gen) for i in '.'*10]]
- print (ttt)
- while 1:
- t = ttt[-1][1:] + [next(gen)]
- if t not in ttt:
- print(t, len(ttt))
- ttt += [t]
- else:
- break
- # ends at [1, 6, 0, 7, 7, 0, 3, 1, 0, 0] 18429
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement