Explorar o código

rename random ro randomness-test-file

Paola Fontana Gasio %!s(int64=4) %!d(string=hai) anos
pai
achega
39928d23b3
Modificáronse 1 ficheiros con 16 adicións e 0 borrados
  1. 16 0
      tests/randomness-test-file

+ 16 - 0
tests/randomness-test-file

@@ -0,0 +1,16 @@
+import random
+
+def normal(mu):
+    return int(round(random.normalvariate(mu,3),0))
+
+for i in range (10):
+    pm = random.randint(0,1)
+    next_note = normal(2)
+    if pm == 1:
+        while next_note > 0:
+            next_note = normal(2)
+    else:
+        while next_note <= 0:
+            next_note = normal(-2)
+    print(pm, next_note)
+