pandora_t_for_time/pi.py

21 lines
534 B
Python
Raw Normal View History

2023-10-08 11:19:05 +00:00
from mpmath import mp
mp.dps = 10000
PI = str(mp.pi).replace('.', '')
class random(object):
PI = str(mp.pi).replace('.', '')
def __init__(self, offset=0):
self.position = offset
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)