Skip to content

wataridori/bias-random

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BiasRandom for PHP

StyleCI Build Status Latest Stable Version Total Downloads Latest Unstable Version License

Requirement

  • PHP >= 5.4

Install

You can install and manage BiasRandom by using Composer

composer require wataridori/bias-random

Or add wataridori/bias-random into the require section of your composer.json file then run composer update

Usage

$biasRandom = new wataridori/BiasRandom/BiasRandom();
$data = [
    'wataridori' => 10,
];
$biasRandom->setData($data);
$biasRandom->addElement('Tran', 20);
$biasRandom->addElement('Duc', 30);
$biasRandom->addElement('Thang', 40);

// Random one element with weight.
$biasRandom->random();

// Random two elements
$biasRandom->random(2);

Test

Just run phpunit to start test.

About

Random elements with specific bias

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages