Example #1
0
          strings: ["You hear a loud noise ^2000 <br><br>Sounds like someone banging a metal door ^500 . ^500 . ^500 . ^500 <br>\"What metal door?\" you mumble to yourself as you stand at your desk. ^1000 <br>The once bustling library is now deserted. ^1000 <br> Where did everyone go? ^1000 <br><br> You follow the noise to the back wall of the library... ^500 <br>Between the Men's room and the phonebooth you see a strange metal door... ^1000 <br>Never noticed that before. ^1000 <br>There's a small panel on the door, something you might see on a door to a speakeasy ^1000 ...in a movie maybe.<br><button class=\"toggle\">Slide Open</button>"],
          typeSpeed: 20
        });
    });
  </script>
  <div class="game">
  <div class="text_animation">
    <span class="story"></span>
  </div>
  <div class="puzzle">
    <p class="text">A small torn piece of paper falls from the opening:</p>
    <div class="note"><p>

<?php 
#_-_-_-_-_-_puzzle one_-_-_-_-_-_
$puzzle_one = rand_book_gen(3);
#returns an array of three random books
$score = 0;
$question_one = mt_rand(0, 2);
#picks one of these random books to be metaphoned. This variable will also serve as the correct answer.
$pieces = explode(" ", $puzzle_one[$question_one]['title']);
#breaks title into individual words
$word_count = count($pieces);
#runs each word through metaphone and prints results
for ($x = 0; $x < $word_count; $x++) {
    echo metaphone($pieces[$x]) . " ";
}
echo '</div><p class="text">As you return to your desk you notice a pile of strange books on the floor<br><br><button class="books">Pick up Books</button></p><div class="choices">';
echo '<form method="POST" action="level_one2.php"><fieldset id="metaphone"><legend>You pick up...</legend>';
echo "<input type=\"radio\" name=\"option\" value=0 required>" . $puzzle_one[0]['title'] . ", " . $puzzle_one[0]['author'] . ", " . $puzzle_one[0]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=1 required>" . $puzzle_one[1]['title'] . ", " . $puzzle_one[1]['author'] . ", " . $puzzle_one[1]['year'] . "<br>";
Example #2
0
}
include_once 'includes/header.php';
if (isset($message)) {
    echo $message;
}
?>
<body>
  <script>$(document).ready(function(){
      $(".books").click(function(){
          $(".choices").toggle(1000);
      });
  });
  </script>
<?php 
#_-_-_-_-_-_puzzle two_-_-_-_-_-_
$puzzle_two = rand_book_gen(4);
$question_two = mt_rand(0, 3);
#picks one of these random books to be metaphoned
$pieces = explode(" ", $puzzle_two[$question_two]['title']);
#breaks title into words
$word_count = count($pieces);
#runs each word through metaphone and prints results
for ($x = 0; $x < $word_count; $x++) {
    echo metaphone($pieces[$x]) . " ";
}
echo '</div><p class="text">As you round the corner, you run into a shelving cart.<br>It has four books on it<br><button class="books">Look at the Books</button></p><div class="choices">';
echo '<form method="POST" action="level_one3.php"><fieldset id="metaphone"><legend>You pick up...</legend>';
echo "<input type=\"radio\" name=\"option\" value=0>" . $puzzle_two[0]['title'] . ", " . $puzzle_two[0]['author'] . ", " . $puzzle_two[0]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=1>" . $puzzle_two[1]['title'] . ", " . $puzzle_two[1]['author'] . ", " . $puzzle_two[1]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=2>" . $puzzle_two[2]['title'] . ", " . $puzzle_two[2]['author'] . ", " . $puzzle_two[2]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=3>" . $puzzle_two[3]['title'] . ", " . $puzzle_two[3]['author'] . ", " . $puzzle_two[3]['year'];
Example #3
0
include_once 'includes/header.php';
if (isset($message)) {
    echo $message;
}
?>
<body>
<script>$(document).ready(function(){
    $(".books").click(function(){
        $(".choices").toggle(1000);
    });
});
</script>

<?php 
#_-_-_-_-_-_puzzle four_-_-_-_-_-_
$puzzle_four = rand_book_gen(1);
#picks one of these random books to be metaphoned
$pieces = explode(" ", $puzzle_four[0]['title']);
#breaks title into words
$word_count = count($pieces);
#runs each word through metaphone and prints results
$correct_answer = $puzzle_four[0]['book_id'];
for ($x = 0; $x < $word_count; $x++) {
    echo metaphone($pieces[$x]) . " ";
}
echo '</div><p class="text">You immediately notice a drawer open on the card catalog.<br><button class="books">Find a Card</button></p><div class="choices">';
echo '<form method="POST" action="level_one_final.php"><fieldset id="metaphone"><legend>You look for...</legend>';
echo "<input type=\"text\" name=\"four\" size=\"100\" autofocus=\"\"><br>";
echo "<input type=\"hidden\" name=\"score_one\" value=" . $score . ">";
echo "<input type=\"hidden\" name=\"correct_answer\" value=" . $correct_answer . ">";
echo "<br><br><input type=\"submit\" name=\"submit\"></fieldset></form></div>";
Example #4
0
if (isset($message)) {
    echo $message;
}
?>

<body>
  <script>$(document).ready(function(){
      $(".books").click(function(){
          $(".choices").toggle(1000);
      });
  });
  </script>

<?php 
#_-_-_-_-_-_puzzle three_-_-_-_-_-_
$puzzle_three = rand_book_gen(4);
$question_three = mt_rand(0, 3);
#picks one of these random books to be metaphoned
$pieces = explode(" ", $puzzle_three[$question_three]['title']);
#breaks title into words
$word_count = count($pieces);
#runs each word through metaphone and prints results
for ($x = 0; $x < $word_count; $x++) {
    echo metaphone($pieces[$x]) . " ";
}
echo '</div><p class="text">You return to your desk to find four books sitting neatly in a pile...<br><button class="books">Pick up Books</button></p><div class="choices">';
echo '<form method="POST" action="level_one4.php"><fieldset id="metaphone"><legend>You pick up...</legend>';
echo "<input type=\"radio\" name=\"option\" value=0>" . $puzzle_three[0]['title'] . ", " . $puzzle_three[0]['author'] . ", " . $puzzle_three[0]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=1>" . $puzzle_three[1]['title'] . ", " . $puzzle_three[1]['author'] . ", " . $puzzle_three[1]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=2>" . $puzzle_three[2]['title'] . ", " . $puzzle_three[2]['author'] . ", " . $puzzle_three[2]['year'] . "<br>";
echo "<input type=\"radio\" name=\"option\" value=3>" . $puzzle_three[3]['title'] . ", " . $puzzle_three[3]['author'] . ", " . $puzzle_three[3]['year'];