-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.php
More file actions
36 lines (28 loc) · 741 Bytes
/
verify.php
File metadata and controls
36 lines (28 loc) · 741 Bytes
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
<?php
$block_hash = "";
$active_players = 10;
$answer_key = preg_replace("/[^0-9]/", "", $block_hash);
$winner = substr($answer_key, -1, 1);
if($winner == 0) $winner = 10;
$jackpot0 = substr($answer_key, -1, 1);
$jackpot1 = substr($answer_key, -2, 1);
$jackpot2 = substr($answer_key, -3, 1);
$n=1;
while($winner > $active_players) {
$n++;
$nn = $n * -1;
$winner = substr($answer_key, $nn, 1);
if($winner == 0) $winner = 10;
if($n > strlen($answer_key)) {
$winner = 1;
$active_players = 1;
}
}
echo "Answer Key: ".$answer_key."\r\n";
echo "Player in position #".$winner." won!\r\n";
if($winner == $jackpot0) {
if($winner == $jackpot1 && $winner == $jackpot2) {
echo "They also won the jackpot.\r\n";
}
}
?>