dice-roller 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dice.rb +1 -1
- 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: 68f166d58c6016113d7dc9fe2c7cbf96f89f1aae
|
4
|
+
data.tar.gz: 58b13cd9624b37a866b68c9ede99eda375132942
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4732d1d881b695b9ba53772d6c2cd23ece9ea05cc9ed75843866467adf86c5e9162f55b084df2cb03aa774de49c7a4a3400aa74a85f72d9cbe94ee6b1278a8d2
|
7
|
+
data.tar.gz: e7538d7f68e36747ba1e66f584bac513d3c589b976f5e947e5c9474e7abca27c9cf6271ed5b22bedf788e434acdb480e80cf13aaa1f0586a78148539858de6c2
|
data/lib/dice.rb
CHANGED
@@ -31,7 +31,7 @@ class Dice
|
|
31
31
|
# Match groups of dices, calculate the groups and reinsert them
|
32
32
|
dice_groups(str).each do |group|
|
33
33
|
# Roll each dice
|
34
|
-
dices, sides, modifier, modifier_amount = group.scan(/(\d+)d(\d+)(\D
|
34
|
+
dices, sides, modifier, modifier_amount = group.scan(/(\d+)d(\d+)(\D*)(\d*)/).flatten
|
35
35
|
results = Integer(dices).times.collect { rand(Integer(sides)) + 1 }.sort
|
36
36
|
|
37
37
|
# If a modifier is present, handle that
|