randomness 0.0.3 → 0.0.4
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/main.rb +6 -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: 2bee6261c3e9229385416009281a278a02ea8aa8
|
4
|
+
data.tar.gz: 0b99b596ee325b041002a8f6ca0ded38ad1e6e8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 640c192b5f7b857144d3660446f1214139c9405151d07f05e5336314d45d82640fb746e312bc3f589cec076314a673725bab38ff76c461b6fd5a92c933c1bd55
|
7
|
+
data.tar.gz: 52c8783affdbaa959f048cd423aea372c368dceb7edebf50f18eb9c4e8198d26358f71d6ffd0239778a571f3aaa7360f1cf58499d198928ba67a7035f648df11
|
data/lib/main.rb
CHANGED
@@ -8,6 +8,11 @@ module Randomness
|
|
8
8
|
def randint(min, max)
|
9
9
|
return rand(max - min + 1) + min
|
10
10
|
end
|
11
|
+
#Returns the specified amount of random numbers between min and max(inclusive of both end points).
|
12
|
+
#There will not be repeated numbers.
|
13
|
+
def randints(min, max, amount)
|
14
|
+
return randchoices((min..max).to_a(), amount)
|
15
|
+
end
|
11
16
|
#Returns a random selection from the list.
|
12
17
|
def randchoice(list)
|
13
18
|
return list[rand(list.size())]
|
@@ -30,4 +35,4 @@ module Randomness
|
|
30
35
|
def randword(string)
|
31
36
|
return randchoice(string.split(' '))
|
32
37
|
end
|
33
|
-
end
|
38
|
+
end
|