This repository has been archived by the owner on Jan 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
beatability-stats.clj
27 lines (26 loc) · 1.6 KB
/
beatability-stats.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(defn beatability-stats [n]
(let [{:keys [beatable not-beatable]} (->> (take n (repeatedly #(-> java.util.Random
new
.nextLong
java.lang.Math/abs)))
(map crystal-key-item-randomizer.seeds/generate)
(group-by #(if (-> % :seed :beatable?)
:beatable
:not-beatable)))]
{:beatable (count beatable)
:not-beatable (count not-beatable)
:ratio (float (/ (count beatable)
n))}))
(let [n 10000
{:keys [beatable not-beatable]} (->> (take n (repeatedly #(-> java.util.Random
new
.nextLong
java.lang.Math/abs)))
(map #(crystal-key-item-randomizer.seeds/generate % {:randomize-badges? true}))
(group-by #(if (-> % :seed :beatable?)
:beatable
:not-beatable)))]
{:beatable (count beatable)
:not-beatable (count not-beatable)
:ratio (float (/ (count beatable)
n))})