Skip to content
Simple gem for Ruby which allow to pick a value from array with given probability for each element.
Ruby
Find file
Pull request Compare This branch is 5 commits behind esse:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
Gemfile
README
Rakefile
guided_randomness.gemspec

README

Simple gem for Ruby which extends Array class, and gave possibility to pick element from it at random, however with certain probability (probability is given for each element).

Instalation:

gem install guided_randomness


Usage:

require 'guided_randomness'
[1,2,3].get_rand([0.5, 0.3, 0.2])

or
require 'guided_randomness'
[1,2,3].get_rand([4,12,9])

LICENSE ?
Something went wrong with that request. Please try again.