CSCE 590: Problem Set 4

Due: Wednesday, 8 May 2002, 4:00pm

Upload Problem Set

Says You! The Game of keywords and URLs.

Inspired by the NPR game Says You! and the timely release of the Google SOAP APIs this problem set consists of the developement of a web-centric url-guessing game.

In Says You! the contestants are giving a word and several possible definitions for it. One of the definitions is the correct one while the other ones are made up by the other contestants. The players receive points for choosing the correct answer or for having their answer chosen.

Figure 1: System Architecture. We show only three clients but the system should support any number of clients.
Our game is a little different. For each turn one of the players will be the "keyword-chooser". This role should rotate, in order, among all the players. The keyword-chooser chooses a keyword and submits it to the server. All the players are then told what the keyword is and are asked for a URL and a title. At the sime time the server does a google query and retrieves the first hit's URL and title. Once all the players submit their guesses the server combines all them with the real one (in a random order). The players are then all asked the same multiple-choice question: Which is the first Google hit for keyword X?. The players provide their answer. Once all the answers are in, the scores are calculated. A player gets 5 points for choosing the correct answer and 2 points for each player that chose his answer as the correct one. The results are then given back to all the players and a new round starts.

Please note that while Im saying things like "the server tells the clients" this does not mean that you should implement callbacks. Instead you should to client-side polling at the appropiate times (and, only at the appropiate times).

The server needs to only support one game at a time (unlike PS3). Also, the server must support an http interface (feel free to reuse code from PS1). It the server receives a GET on its http port it should return an XHTML file which summarize the current scores for the game as well as listing the latest question that was given to the players. The XHTML should be generated by using the DOM interface of the xerces parser. The sytem architecture should look something like Figure 1.

You can not use the googleapi.jar program provided by google for your final project (you probably want to use it for testing purposes). Instead you should use the wsdl they provide along with the same Apache SOAP you are using for all the other clients.

Sample use case:

Arthur, ford, trillian, and zaphod start a new game. Each one runs a client and provides a user name to join the game. zaphod choses the first keyword "pangalactic gargleblaster". Each of the players is asked something like:
Arthur, the keyword is pangalactic gargleblaster, what is your URL?
Title: Dictionary.com: Galactic.
Hostname: www.dictionary.com

Once the aswers are in, each of the players is presented with the same question:
Which one of the following is the first hit for the Google query
"pangalactic gargleblaster"?

1- DIRK | pangalactic gargleblaster <interconnected.org>

2- Dictionary.com: Galactic <www.dictionary.com>

3- Dark Age of Camelot: Guild Listing for Rodger's 
   Rangers <www.camelotherald.com>

4- Star Trek Beer <www.halfbakery.com>

5- PanGalactic GargleBlaster < www.darkwood.org>

>3
The scores are then calculated, sorted, and presented to the players
Results for this round:

zaphod: 9
    4 for having his answer chosen by ford, trillian
    5 for choosing the correct answer
arthur: 2
    2 for having his answer chosen by arthur
trillian: 0
ford: 0

Current score:

zaphod: 9
arthur: 2
trillian: 0
ford: 0
The game ends when one of the players reaches 20 points.

Questions



José M. Vidal
Last modified: Sat Apr 20 18:12:37 EDT 2002