onody/gachagacha

Gacha-Gacha is an implementation of weighted randomization in PHP.

1.0.0 2015-01-22 06:24 UTC

This package is not auto-updated.

Last update: 2024-04-23 14:10:58 UTC


README

Build Status Coverage Status

Description

Gacha-Gacha is an implementation of weighted randomization in PHP.
Gacha-Gacha requires PHP >= 5.3.3.

Usage

require_once './vendor/onody/gachagacha/src/autoload.php';

$gachagacha = new \GachaGacha\Picker();

$gachagacha->set('Marks',    30.124);
$gachagacha->set('Daniel',   20);
$gachagacha->set('Schuster', 0);

$gachagacha->pick();        // single item
$gachagacha->pick(1000);    // array of items

Install

{   
    "require": {
        "onody/gachagacha": "1.0.0"
    }
}
php composer.phar install

Licence

[MIT]

Author

onody