pip install r_repeat
- Open up the wiki to see how everything works or check the examples
- Enjoy
from r_repeat import repeat, seed
@repeat(n=1e6) # run this function 1000000 times
@seed(kwarg=['rng1', 'rng2']) # insert random numbers into rng1 and rng2
def f(rng1, bias, rng2):
return (rng1 + bias) >= rng2
g = f(bias=0.078) # pass remaining arguments
sum = g.collect() # gather all results
print(f'{sum} wins and {len(g)-sum} losses')
Output:
22%|██▏ | 217913/1000000 [00:21<01:18, 9952.1it/s] (while working)
574945 wins and 425055 losses (after finished)