PHP code example of ouxsoft / luckbydice
1. Go to this page and download the library: Download ouxsoft/luckbydice 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/ */
ouxsoft / luckbydice example snippets
use Ouxsoft\LuckByDice\Factory\TurnFactory;
$turn = TurnFactory::getInstance();
$turn->setNotation('10d10,1d6+3*7,d%');
echo $turn->roll();
// we should be luckier with this next roll
$turn->setLuck(200);
echo $turn->roll();