if ($message) {
if ($answerkey) {
if ($answerkey == $answer) { $right += 1; }
$total += 1;
}
$a = explode('--', $message);
$first = array_splice($a, 0, 1);
$answerkey = $first[0];
$message = implode('--', $a);
$url = "";
$anotherMessage = "You are looking at: " . $url . "
"; } else { if ($answerkey) { if ($answerkey == $answer) { $right += 1; } $total += 1; } $a = array("China", "Russia", "Italy", "Spain", "South Africa", "Brazil", "United States", "Australia"); $b = array(); while (count($a) > 0) { $i = rand(0, count($a)-1); # randomly choose one element in @a array_splice($b, 0, 0, $a[$i]); # put it on the left of @b array_splice($a, $i, 1); # ... and take it out from @a } if ($total > 0) { $anotherMessage = "($right / $total) "; } $anotherMessage .= "The game has just (re)started. The deck is shuffled."; $message = implode('--', $b); $right = 0; $total = 0; $answerkey = ""; } ?>