Web file server - 879Chapter 46A Trivia GameThe code file depends on

879Chapter 46A Trivia GameThe code file depends on two other files: game_class.phpand game_text_class.php. Theformer contains most of the logic for the inner workings of the game, whereas the latter justcontains some boilerplate text. The job of the GameDisplayclass is to extract all the informa- tion from the game state necessary to produce actual HTML pages. The important public functions in the class are .The constructor function. .updateWithAnswer(), which is called with data from the user s submission of a guess. .makeErrorPage(), which returns HTML to display if something has gone wrong. .display(), which returns HTML to display when everything has gone right. Listing 46-2:game_display_class.php_game = $game; $this->_gameText = new GameText(); } // PUBLIC FUNCTIONS// accessorsfunction getPageTitle() { return($this->_pageTitle); } function getBlueColor() { return($this->_blueColor); } function getRedColor() { return($this->_redColor); } Continued52
In case you need affordable webhost to host your website, our recommendation is ecommerce web host services.

Leave a Reply