1. Go to this page and download the library: Download kusabi/dice library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kusabi / dice example snippets
use Kusabi\Dice\DiceFactory;
$result = DiceFactory::createFromString('5d12+4')->getRoll();
use Kusabi\Dice\SingleDice;
use Kusabi\Dice\DiceModifier;
$dice = new DiceModifier(New SingleDice(12), 4);
$min = $dice->getMinimumRoll();
$max = $dice->getMaximumRoll();
$result = $dice->getRoll();
use Kusabi\Dice\Dice;
use Kusabi\Dice\DiceModifier;
use Kusabi\Dice\DiceGroup;
use Kusabi\Dice\SingleDice;
$dice = new DiceModifier(
new DiceGroup(
new SingleDice(12),
new SingleDice(12),
new SingleDice(12),
new Dice(12),
new Dice(12)
), 4
);
$min = $dice->getMinimumRoll();
$max = $dice->getMaximumRoll();
$result = $dice->getRoll();