PHP code example of remp / remp-commons

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

    

remp / remp-commons example snippets


$machine = new Machine(1000);
$machine->addLever(new Lever('variant-a', 10, 1000));
$machine->addLever(new Lever('variant-b', 5, 900));

$result = $machine->run();

echo $result->getWinningLever()->getId(); // variant-a
echo $result->getWinningLeverProbability(); // 0.875