@ 2016-01-13T19:50:08Z <?php
<style>
.n {background-color:#AAF}
.p {background-color:#FAA}
table {font-family:Courier; font-size:12px;}
.gray {color:#AAA;}
</style>
<table>
<?php
$plays = 100;
$ticket_price = 2;
$wins_titles = array('No match', '0 + PB','1','1 + PB','2','2 + PB','3','3 + PB','4','4 + PB','5','Jackpot!');
$wins_payouts = array(0,4,0,4,0,7,7,100,100,50000,1000000,1500000000);
$draw = array();
for($d=0; $d<5; $d++){
$n = rand(1,69);
while(in_array($n, $draw)){
$n = rand(1,69);
}
$draw[] = $n;
}
$draw_pb = rand(1,26);
$rules = array("Any numbers 1 - 69"=>false, "Only 32 and higher"=>32, "Only 65-69"=>65);
echo '<table cellpadding=20><tr><td colspan="2">';
echo '<b>Numbers drawn:</b> <span class="n">'.implode('</span> <span class="n">', $draw).'</span> <span class="p">'.$draw_pb.'</span>';
echo '</td></tr><tr>';
foreach($rules AS $rule => $lowest_number) {
echo '<td>';
echo "<b>{$rule}</b></br>";
$total_wins_value = 0;
$wins = array(0,0,0,0,0,0,0,0,0,0,0,0);
$min = $lowest_number ? $lowest_number : 1;
//$min = false;
for ($i=0; $i<$plays; $i++) {
$play = array();
for($d=0; $d<5; $d++){
$n = rand($min,69);
while(in_array($n, $play)){
$n = rand($min,69);
}
$play[] = $n;
}
$play_pb = rand(1, 26);
$play_matches = 0;
foreach($play AS $num){
if (in_array($num, $draw)) {
$play_matches++;
echo ' <span class="n">'.($num<10?' ':'').$num.'</span>';
} else{
echo ' '.($num<10?' ':'').$num;
}
}
$pb_match = $play_pb==$draw_pb;
if ($pb_match) {
echo ' [<span class="p">'.($play_pb<10?' ':'').$play_pb.'</span>] ';
} else {
echo ' ['.($play_pb<10?' ':'').$play_pb.'] ';
}
$score = $play_matches*2 + ($pb_match?1:0);
$wins[$score]++;
echo "Score: {$score}<br/>";
}
$total_wins_value = 0;
?><hr>
<table>
<tr><th>Match</th><th>Payout</th><th>Count</th><th>Total Win</th></tr>
<?php foreach($wins AS $index=>$count): ?>
<tr <?= ($index==0 || $index==2 || $index==4 ? 'class="gray"':'') ?>>
<td><?= $wins_titles[$index] ?></td>
<td>$<?= number_format($wins_payouts[$index],0) ?></td>
<td><?= $count ?></td>
<?php $win_value = $wins_payouts[$index]*$count; $total_wins_value += $win_value; ?>
<td>$<?= number_format($win_value,0) ?></td>
</tr>
<?php endforeach; ?>
</table>
<hr>
Tickets: <b><?= number_format($plays,0) ?></b><br/>
Spent: <b>$<?= number_format(($spent=$plays*$ticket_price),0) ?></b><br/>
Won: <b>$<?= number_format($total_wins_value,0) ?></b><br/>
Profit: <b><?= number_format(($total_wins_value-$spent)/$spent*100,2) ?>%</b>
<hr/><hr/>
<?php
echo '</td>';
}
echo '</tr></table>';
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 7.0.2 0.033 0.047 20.16 7.0.1 0.010 0.080 20.22 7.0.0 0.007 0.080 20.09 5.6.17 0.027 0.053 20.47 5.6.16 0.007 0.057 20.44 5.6.15 0.007 0.043 18.19 5.6.14 0.013 0.043 18.11 5.6.13 0.010 0.053 18.24 5.6.12 0.003 0.063 20.98 5.6.11 0.003 0.087 21.04 5.6.10 0.007 0.083 21.02 5.6.9 0.003 0.093 20.97 5.6.8 0.007 0.067 20.37 5.5.31 0.017 0.043 20.23 5.5.30 0.000 0.040 17.91 5.5.29 0.007 0.043 18.07 5.5.28 0.007 0.040 20.76 5.5.27 0.003 0.043 20.61 5.5.26 0.007 0.050 20.75 5.5.25 0.020 0.070 20.69 5.5.24 0.317 0.037 20.18
preferences:dark mode live preview
137.36 ms | 1394 KiB | 7 Q