No commit activity in last 3 years
No release in over 3 years
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). Adds the get_rand function to array class, which take array of chances as arguments (for example [1,2,3].get_rand([3,4,5]))
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.5
 Project Readme

Guided Randomness

Description

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])