onody / gachagacha
Gacha-Gacha is an implementation of weighted randomization in PHP.
Installs: 20
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 0
pkg:composer/onody/gachagacha
Requires
- php: >=5.3.3
Requires (Dev)
- phpunit/phpunit: ~4.4
This package is not auto-updated.
Last update: 2025-10-21 20:57:56 UTC
README
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]