php code
Posted On at by milan
Petals Around the Rose
Re-created by: L0g2 St3w
Click the roll button to get started.
I can't tell you how it works but I can tell you the name of the game, and that it is significant!
And I can also tell you it's always an even number!
|
if ($roll) { $gue++; $acc = 0; $q = rand(1,6); $w = rand(1,6); $e = rand(1,6); $r = rand(1,6); $t = rand(1,6); } $total = 0; if ($guess == NULL) { $guess = 0; } if ($q == 5 || $q == 3) { $s = $q - 1; $total = $total + $s; } if ($w == 5 || $w == 3) { $s = $w - 1; $total = $total + $s; } if ($e == 5 || $e == 3) { $s = $e - 1; $total = $total + $s; } if ($r == 5 || $r == 3) { $s = $r - 1; $total = $total + $s; } if ($t == 5 || $t == 3) { $s = $t - 1; $total = $total + $s; } if ($sub) { if ($acc == 1) { $resp = "You must roll the dice before guessing!"; } else if ($guess == $total) { $corr++; $resp = "Correct! The answer was ".$total; } else if ($guess % 2 != 0) { $resp = "It CAN'T be an odd number!"; } else { $resp = "The answer was ".$total.", not ".$guess; } $acc = 1; } if ($corr == NULL) { $corr = 0; } if ($gue == NULL) { $gue = 0; } echo $q. " " .$w. " " .$e. " " .$r. " " .$t. " "; ?> | ";
echo "Guesses: ".$gue; ?> |
|
|
PHP Free Code