Commits

Arne Babenhauserheide  committed a0e0200

better output

  • Participants
  • Parent commits aee2796

Comments (0)

Files changed (1)

 from collections import Counter, defaultdict
 from scipy import std, mean
 
-numtests = 100
+numtests = 300
 rollsperplayer = 30
 succ = set([7,8,9,10])
 botch = set([1])
 if __name__ == "__main__":
     results = defaultdict(list)
     # gather mutltiple times
+    print(numtests // rollsperplayer, "number of players")
     for num in range(numtests//rollsperplayer):
         for min_succ in range(1,5):
             for i in range(1,11):
     keys = list(results.keys())
     keys.sort()
     minsu = 1
-    print("=== min successes:", minsu, "===")
+    print("=== min successes:", minsu, " (95% (2std)) ===")
     for i in keys:
         if i[0] != minsu:
             minsu = i[0]
-            print("\n=== min successes:", minsu, "===")
+            print("\n=== min successes:", minsu, "(95% (2std))===")
         succ = [succ for succ,bot in results[i]]
+        succmean = 100*mean(succ)
+        succstd = 100*std(succ)
         botch = [bot for succ,bot in results[i]]
-        print("dice", i[1], ": succ:", "{:4.2F}".format(mean(succ)*100), "±", "{:4.2F}".format(std(succ)*100), end=" ")
-        print("-- botch:", "{:4.1F}".format(mean(botch)*100), "±", "{:4.1F}".format(std(botch)*100))
+        botchmean = 100*mean(botch)
+        botchstd = 100*std(botch)
+        succfrom = succmean - 2*succstd
+        succto = succmean + 2*succstd
+        botchfrom = botchmean - 2*botchstd
+        botchto = botchmean + 2*botchstd
+        print("dice", i[1], ": succ:", "{:4.2F}".format(succfrom), "-", "{:4.2F}".format(succto), end=" ")
+        print("-- botch:", "{:4.1F}".format(botchfrom), "-", "{:4.1F}".format(botchto))