randomness-test-file 364 B

123456789101112131415161718
  1. #!/usr/bin/env python3
  2. import random
  3. def normal(mu):
  4. return int(round(random.normalvariate(mu,3),0))
  5. for i in range (10):
  6. pm = random.randint(0,1)
  7. next_note = normal(2)
  8. if pm == 1:
  9. while next_note > 0:
  10. next_note = normal(2)
  11. else:
  12. while next_note <= 0:
  13. next_note = normal(-2)
  14. print(pm, next_note)