Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Simple gem for Ruby which allow to pick a value from array with given probability for each element.
Ruby
tag: v0.1.4

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
LICENSE
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])
Something went wrong with that request. Please try again.