[php]
if (!isset($_SESSION[‘cave’])) $_SESSION[‘cave’] = 1;
$cave = $_SESSION[‘cave’];
$direction = $_GET[‘direction’];
if ($cave == 1) {
[/php]
the guru crept into the darkness of the cave. it was so dark, he could see nothing. this was not a new state for the guru, however, and he was comfortable wandering blind. he felt his way along the walls of the tunnel.
eventually, he reached a three-way fork in the tunnel.
should he go left, straight, or right
[php]
}
if (((($cave > 1) && ($cave <= 5)) && ($direction == "left")) || ((($cave > 5) && ($cave <= 8)) && ($direction == "right")) || (($cave > 8) && ($direction == “straight”))) {
if ($cave == 10) {
[/php]
the guru saw a light up ahead. he ran toward it, excited to have finally found the end of these dark caves.
finally, the tunnel opened up into…
[php]
}
else {
$cavespeak = rand(1,5);
if ($cavespeak == 1) echo “
the guru continued through the darkness of the cave until he reached another three-way fork in the tunnel.
“;
if ($cavespeak == 2) echo “
groping in the darkness, the guru made his way to another three-way fork.
“;
if ($cavespeak == 3) echo “
just when the guru thought he was through, another three-way fork in the tunnel appeared.
“;
if ($cavespeak == 4) echo “
the guru reached another three-way fork in the tunnel.
“;
if ($cavespeak == 5) echo “
the guru began to go mad from the darkness, but then he reached a three-way fork and had to make a choice.
“;
[/php]
should he go left, straight, or right?
[php]
}
}
elseif ($_SESSION[‘cave’] > 1) {
[/php]
the guru fell through a hole in the caves and landed in an underground river.
the river carried him into the lake, where he climbed out onto the shore.
[php]
$_SESSION[‘cave’] = 1;
}
$_SESSION[‘cave’] = $_SESSION[‘cave’]+1;
[/php]