dice_stats 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/Dice_Set.rb +5 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70860c6a4f15edd6d821b8f4833e85f05fa281d4
|
|
4
|
+
data.tar.gz: d5cf22b0c0946ba091d3286cb431220a5c08a9fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 571de77edfe6e8cd0c8eb3ea551f7a7fec037be2b314c31fcbeb0327a6f0431ff9595e28f2cab1ce713258c6b89a97bbb4efb0637d766e79aac8ae70a7cf3358
|
|
7
|
+
data.tar.gz: a8d667e66eb737217d90913530e0f42a7b7b2bb0fd3e365c6cfc2285fbbaf1c66615599b5b95b1b66466d7beaeee57dd862be1b9fc8854bb2efda0be5bf385db
|
data/lib/Dice_Set.rb
CHANGED
|
@@ -87,7 +87,10 @@ module Dice_Stats
|
|
|
87
87
|
dice_faces = sub_string_split[1].to_i
|
|
88
88
|
|
|
89
89
|
calculate_probability = (probability_distribution == nil) && (number_of_dice * dice_faces <= 1000)
|
|
90
|
-
|
|
90
|
+
|
|
91
|
+
if (number_of_dice * dice_faces > 1000)
|
|
92
|
+
@aborted_probability_distribution = true
|
|
93
|
+
end
|
|
91
94
|
|
|
92
95
|
@dice << Dice.new(number_of_dice, dice_faces, calculate_probability)
|
|
93
96
|
elsif (split_string[i].to_i > 0)
|
|
@@ -102,7 +105,7 @@ module Dice_Stats
|
|
|
102
105
|
if probability_distribution != nil
|
|
103
106
|
@probability_distribution = probability_distribution
|
|
104
107
|
else
|
|
105
|
-
if @aborted_probability_distribution || (100_000 < @dice.inject(
|
|
108
|
+
if @aborted_probability_distribution || (100_000 < @dice.inject(1) { |m,d| m * (d.sides * d.count) })
|
|
106
109
|
@probability_distribution = {}
|
|
107
110
|
@aborted_probability_distribution = true
|
|
108
111
|
else
|