Skip to content

Instantly share code, notes, and snippets.

@BAGELreflex
Created March 17, 2021 20:49
Show Gist options
  • Save BAGELreflex/547e624ad31736f193ffe08f776f2af8 to your computer and use it in GitHub Desktop.
Save BAGELreflex/547e624ad31736f193ffe08f776f2af8 to your computer and use it in GitHub Desktop.
<?php
$section1min = 1;
$section1max = 12;
$section2min = 25;
$section2max = 36;
$line1min = 14;
$line1max = 17;
$line2min = 20;
$line2max = 24;
$numbers = [0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36];
$totalBet = 0;
$totalPayout = 0;
$iterations = 10000;
$bet = 300;
for ($i = 0; $i < $iterations; $i++) {
$picked = array_rand($numbers, 1);
$payout = 0;
$totalBet += $bet;
if ($picked <= $section1max || $picked >= $section2min) {
$payout = 300;
}
else if (($picked >= $line1min && $picked <= $line1max) || ($picked >= $line2min && $picked <= $line2max)) {
$payout = 425;
}
$totalPayout += $payout;
}
echo 'Total Bet: $' . number_format($totalBet) . PHP_EOL;
echo 'Total Payout: $' . number_format($totalPayout) . PHP_EOL;
echo '=============' . PHP_EOL;
echo 'Total Gross: $' . number_format($totalPayout - $totalBet) . PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment