Program 7



The last program will be a project due in three installments. The project will be to build a Wheel of Fortune game. If you don't know what Wheel of Fortune is, its on TV in the late afternoons, so you can watch it a couple of times and see what its like.

Basically, the game is a word guessing game, where a word or phrase is to be guessed by guessing letters one at a time. For example, if the phrase is "socket programming is fun", the players would see a set of blanks representing the letters "------ ----------- -- ---". As the players guess the letters, they are put into the word. For example, if someone guessed the letter "m", "------ ------mm--- -- ---" would be displayed. Another guess of "n" would result in "------ ------mm-n- -- ---".

Each guess that is correct results in the banking of an amount of money, which is decided by a spin of a wheel. If the wheel spin showed $500, then guessing an "m" would result in winnings of $1000. However, you don't get to keep the money unless you are the player that finally guesses the phrase.

Vowels can't be guessed, they have to be purchased for $50 for a guess. For example, if someone bought the letter "o", the o's would be shown in the phrase, and it would cost that player $50. A player has to have already accumulated some money to guess a vowel.

An incorrect guess passes the turn to the next player.

A correct guess allows the same player to spin and guess again.

The wheel has some other values on it, such as "Lose Your Turn" and "Bankrupt". Losing your turn passes the opportunity to guess to the next player in turn. Going bankrupt takes away all of your money and you lose your turn - bummer!

Each player or client would have to be able to see the current state of the phrase with all guessed letters showing, the amount of money they have accumulated, and ALL letters that have been guessed.

Structure

The server would be responsible for signing up players - getting a name and setting up communications, generating the spin, which would be a random value chosen from the set of possible wheel values, and processing user guesses that are sent to it. It should keep each player updated after every operation.

The client would mostly just process information and display it on the screen, and get the guesses from the user to pass to the server.

Extras

There are some additional things that "Wheel" does. The wheel sometimes has chits for avoiding a "Lose Your Turn" spin, or bonus locations, like trips and such. Handling these is optional. You could also allow "Speed Wheel", where consonants have a set value and there is no spinning.

The Phrase Database

The phrases will probably come from some sort of database. Normally, the players get a hint of some kind, and there are even some special categories. For example: