888Part VCase Studiesgame_text_class.phpYour humble authors try really hard (Web site hosting)

888Part VCase Studiesgame_text_class.phpYour humble authors try really hard to make this stuff interesting, but in this case, we mustdeclare defeat. The GameTextclass just wraps up some boilerplate HTML into member func- tions so that the GameDisplayclass can ask for it. Enough said? The functions use our favorite technique for creating large chunks of boilerplate, which is theheredocsyntax. (See Chapter 8 for more on the uses of heredoc.) Listing 46-3 shows thegame_text_class.php. Listing 46-3:game_text_class.phpWelcome to the Certainty Quiz! The game that tests

  • how much you know about how much and
  • how much you know abouthow much you know about how much!

    The object

    The goal is to answer as many questionscorrectly as possible. Answer questions(starting with the first one at the left), by choosingvalues above and below where you think the right answer lies. Answers are correct if they include the real answer in the range. The narrower your guesses, the longer you ll survive. There are ten levels; if you think the questions are too easy, keep going. EOT; return($intro); } function rules () { $rules = <<Rules and scoring
  • Four points subtracted from your credit for every incorrect answer.
  • One point added to your credit for every correct answer, minus a penalty for the range of your answer. Specifying the entire range possible subtracts four points (for a total of -3); specifying a single step of the range subtracts nothing(for a total of +1). Intermediate ranges give intermediate results.
    You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

  • Leave a Reply