randomness 0.1.1 → 0.1.2
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/changelog.txt +2 -4
- data/lib/main.rb +8 -0
- 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: 4ff8779f4b4f6505a3fdc5386b0f127a547309f7
|
4
|
+
data.tar.gz: 829ac1952c112b538d7909fe56f6be1c80a58e67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 443491e8426ac5660db3cf76e7fc9477b30200894d7b1ca896dceb85475f4846e297533809b98c876e9a6851e78d671e5a1f8549a9d0e92d530a1f762843f844
|
7
|
+
data.tar.gz: 3f4b06fd9841b189f9fb8004b64e5f274f1d8222c1b577b9b04e2743e4fee088355143f7bc718491aba82dd8c18b78fcb4522a690260827f6523ba27ac19e072
|
data/lib/changelog.txt
CHANGED
data/lib/main.rb
CHANGED
@@ -81,4 +81,12 @@ module Randomness
|
|
81
81
|
def randhashvalues(hash, amount)
|
82
82
|
return randchoices(hash.values(), amount)
|
83
83
|
end
|
84
|
+
#Shuffles the array and returns the result.
|
85
|
+
def shufflearray(array)
|
86
|
+
return array.shuffle()
|
87
|
+
end
|
88
|
+
#Shuffles the key-value mapping in the given hash and returns the result.
|
89
|
+
def shufflehash(hash)
|
90
|
+
return hash.values().shuffle()
|
91
|
+
end
|
84
92
|
end
|