pandora_t_for_time/pi.py
2023-11-16 16:17:25 +01:00

18 lines
526 B
Python

from mpmath import mp
class random(object):
def __init__(self, offset=0):
self.position = offset
mp.dps = 10000 + offset
self.PI = str(mp.pi).replace('.', '')
self.numbers = list(map(int, self.PI[offset:]))
def __call__(self):
if not self.numbers:
offset = mp.dps
mp.dps += 1000
self.PI = str(mp.pi).replace('.', '')
self.numbers = list(map(int, self.PI[offset:]))
self.position += 1
return self.numbers.pop(0)