Created
March 30, 2016 14:13
-
-
Save adambutler/1ceba475235b551ad732901dbdef70c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i = 100 | |
z = [] | |
i.times do | |
a = [] | |
while true | |
c = (0...5).map { (65 + rand(26)).chr }.join | |
break if a.include? c | |
a << c | |
end | |
z << a.size | |
end | |
puts """ | |
MIN: #{z.min} | |
MAX: #{z.max} | |
AVG: #{z.sum / i} | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment