dice_stats 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/Dice_Set.rb +7 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2585fee905bf91f1d0b97de506e244c6a12b552
4
- data.tar.gz: 990f862e6ffe00adba7941fc08c6b2fd2af88de5
3
+ metadata.gz: 49cf8ee02d9aa7ef9ee4abb3688726b713c9224b
4
+ data.tar.gz: 650b608be6c55f0265820eff8422763e551ea977
5
5
  SHA512:
6
- metadata.gz: 1042285361fee86176d87b58ecacd339e563f083dbea7cfbf8493d1f5dd710e70105672c5afaa19cff1747243e3c911ebb915d6b7dc3f03fc27cab5c2622c84f
7
- data.tar.gz: 21829b5c09f5f28532a397b9ec54b350f1fa0c68e235eb59a09e56585a04bae603467ce0f090f513961fc55525c95ea11fb379704533a4524cbb0a348faae8b3
6
+ metadata.gz: 64229f6e1210d768cd6a78a718ec03e65ac71f4f58b673426f31b61a7f15fb557e887b510224ae1bd50905505d9a1af3d805c6c6456f261cca3bdff4fbb6dc4e
7
+ data.tar.gz: e8552eaa73ee3f102e87f6a6325f1517da34f00d38862a6ca48a23718530645121338eb31f6941a2ff2581c1a107db3de4d0158ec66b49463f0c563d0a17d8ee
data/lib/Dice_Set.rb CHANGED
@@ -174,8 +174,7 @@ module Dice_Stats
174
174
  ##
175
175
  # Instantiates and returns a Filtered_distribution. See the documentation for Filtered_distribution.rb.
176
176
  def p
177
- weighted_prob_dist = @probability_distribution.inject(Hash.new) { |m,(k,v)| m[k+@constant] = v; m }
178
- filtered_distribution = Internal_Utilities::Filtered_distribution.new(weighted_prob_dist)
177
+ filtered_distribution = Internal_Utilities::Filtered_distribution.new(adjusted_distribution)
179
178
  return filtered_distribution
180
179
  end
181
180
 
@@ -184,5 +183,11 @@ module Dice_Stats
184
183
  def too_complex?
185
184
  @aborted_probability_distribution
186
185
  end
186
+
187
+ ##
188
+ # Add the constant the the probability distribution, useful for printing / output purposes
189
+ def adjusted_distribution
190
+ @probability_distribution.inject(Hash.new) { |m,(k,v)| m[k+@constant] = v; m }
191
+ end
187
192
  end
188
193
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dice_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Foy