CS21 Lab 7: Top-Down Design:

Wheel-Of-Fortune

Design due November 1; Full game due November 8, 2014

Run update21, if you haven't already, to create the cs21/labs/07 directory. Then cd into your cs21/labs/07 directory and create the python program for lab 7 in this directory.

Remember that your programs are graded on both correctness and style. In particular, each function needs a comment!


Introduction

You are going to implement a single-player version of the Wheel of Fortune TV game show. Wheel of Fortune is a phrase guessing game, where the player builds up potential winnings by spinning the wheel and correctly guessing consonants in the hidden phrase. If, after seeing some of the letters in the phrase, they can guess what the phrase is, they win the money.

For our version, the computer will read in phrases from a file and randomly choose one for the game. The player then has four options:

  1. spin the wheel
  2. buy a vowel
  3. guess the puzzle
  4. quit the game
1. SPIN THE WHEEL

The wheel has a variety of cash options, such as $200, $400, etc, as well as a BANKRUPT option. If the user "spins" the wheel and it lands on one of the cash options, the player then guesses a consonant they think is in the phrase. If, for example, the wheel lands on $400, the player guesses a "t", and the phrase has two t's, the player gets 2*$400 added to their potential winnings. Money can only be added to the potential winnings by spinning the wheel and guessing a consonant that's in the phrase. Only one consonant can be guessed per spin.

The BANKRUPT option causes the player to lose the game and any potential winnings!

Since we are only writing a single-player game, ignore the "Lose-A-Turn" option shown on the following wheel.

2. BUY A VOWEL

The player is not allowed to guess vowels *unless* they "buy a vowel" for $250. To do this, the player must have at least $250 in their potential winnings. Whether the bought vowel is in the phrase (one or more times) or not, $250 is always subtracted from their potential winnings.

3. GUESS THE PHRASE

As correct letters are guessed and vowels are bought, those letters are displayed in the puzzle (originally all -'s, see the examples below). Once the player thinks they know what the phrase is, they can end the game by taking a guess at the phrase. If their guess is correct, they win the money. If not, they lose all potential winnings.

4. QUIT

If the users wants to give up early, they can choose to quit which will then abort the game, display the phrase, and tell them they don't win *anything*.

Top-Down Design

The focus of this assignment is for you to practice using top-down design to construct your solution incrementally. This assignment spans two weeks. In the first week, you are required to design your solution and implement minimalistic function stubs for your design. In the second week, you will finish implementing and testing the full game.

Note: Once you have your top-level design done you need to run handin21 and send me an email that you have completed your top-level design. I will look at your design and email you with feedback on your design within 24-48 hours. The earlier you handin your design, the earlier you can continue working on your full program. You should wait to hear back from me before continuing on your program because if I suggest you do something differently, you may have to redo some of your code.

For the design of a program in the first week, you should have:

Here is a simple example of a top-down design.

Wheel-Of-Fortune Examples

Here are two examples of how your wheel-of-fortune program should work.

Example 1
Example 2


Requirements
Helpful tips
Extensions

Extensions are not a required part of lab 7, but you may want to try adding some once you have the game fully implemented and tested.

Here are some fun extensions that you might want to add to your program:

  1. give the user a choice of the kind of phrases to be used in the game (such as quotes, famous last words, proverbs, etc)
  2. add some ASCII art to the program (the wheel):
    $100
    $500
    $250
    $1000 <>======================
    
    (here's a nice ASCII text generator)
  3. we didn't account for these situations, so add them to your code:
      * what happens when there are only vowels left?
      * what happens when there are no letters left to guess?
    
  4. allow user to play more than one game, adding to their winnings
  5. make it a two- or three-player game
  6. ask the user if they want a hard or easy game (adjust the wheel accordingly)

Submit

Once you are satisfied with your programs, hand them in by typing handin21 at the unix prompt.

You may run handin21 as many times as you like, and only the most recent submission will be recorded. This is useful if you realize, after handing in some programs, that you'd like to make a few more changes to them.