PHP code example of porthou / dicebag

1. Go to this page and download the library: Download porthou/dicebag 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/ */

    

porthou / dicebag example snippets



use DiceBag\DiceBag;

$diceBag = DiceBag::factory('4d6dl1');

echo $diceBag;


use DiceBag\DiceBag;
use DiceBag\Randomization\MersenneTwister;

$randomizationEngine = new MersenneTwister();

$diceBag = DiceBag::factory('10f', $randomizationEngine);