Skip to content

anonymous /bestof5.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
max = 100
iterations = 10**6
total = 0
iterations.times {
rolls = []
5.times { rolls.push rand(max) }
total += rolls.max
}
puts total.to_f/iterations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.