Project 6: Wheel of Fortune

You will write a program to let two people play a simplified game of Wheel of Fortune. Here's how the simplified version works:

What you need to do

You must write a program that will prompt the user to enter a secret phrase, then let "player 2" (in reality, you will play both players) guess letters until they win.

You are given some code to begin with [download]. Fill in both of the functions defined in the starter code, and then write your main function. You will probably find the two functions in the starter code useful when writing your main function.

You may assume everything typed in by the players is in lowercase.

You may assume that the player's money value is allowed to drop into the negatives (if they buy too many vowels). A challenge problem (see below) is to prevent this.

Sample Interaction

(What the user types is in bold.)
(Program begins)
Enter a phrase: too hot to hoot

Puzzle is: ___ ___ __ ____
You have 0 dollars.
Consonants are worth 4 dollars.
Enter a letter: t

There are 4 t's.
You make 16 dollars.

Puzzle is: t__ __t t_ ___t
You have 16 dollars.
Consonants are worth 57 dollars.
Enter a letter: a

Letter not in the puzzle.

Puzzle is: t__ __t t_ ___t
You have 16 dollars.
Consonants are worth 46 dollars.
Enter a letter: o

You bought a vowel for 10 dollars each.
There are 6 o's.
You spend 60 dollars.

Puzzle is: too _ot to _oot
You have -44 dollars.
Consonants are worth 8 dollars.
Enter a letter: h

There are 2 h's.
You make 16 dollars.

You won -28 dollars!
The phrase was too hot to hoot.
(Program ends)
Another sample run:
(Program begins)
Enter a phrase: rhodes college

Puzzle is: ______ _______
You have 0 dollars.
Consonants are worth 30 dollars.
Enter a letter: l

There are 2 l's.
You make 60 dollars.

Puzzle is: ______ __ll___
You have 60 dollars.
Consonants are worth 11 dollars.
Enter a letter: c

There are 1 c's.
You make 11 dollars.

Puzzle is: ______ c_ll___
You have 71 dollars.
Consonants are worth 98 dollars.
Enter a letter: r

There are 1 r's.
You make 98 dollars.

Puzzle is: r_____ c_ll___
You have 169 dollars.
Consonants are worth 36 dollars.
Enter a letter: h

There are 1 h's.
You make 36 dollars.

Puzzle is: rh____ c_ll___
You have 205 dollars.
Consonants are worth 22 dollars.
Enter a letter: e

You bought a vowel for 10 dollars each.
There are 3 e's.
You spend 30 dollars.

Puzzle is: rh__e_ c_lle_e
You have 175 dollars.
Consonants are worth 69 dollars.
Enter a letter: g

There are 1 g's.
You make 69 dollars.

Puzzle is: rh__e_ c_llege
You have 244 dollars.
Consonants are worth 36 dollars.
Enter a letter: o

You bought a vowel for 10 dollars each.
There are 2 o's.
You spend 20 dollars.

Puzzle is: rho_e_ college
You have 224 dollars.
Consonants are worth 89 dollars.
Enter a letter: d

There are 1 d's.
You make 89 dollars.

Puzzle is: rhode_ college
You have 313 dollars.
Consonants are worth 8 dollars.
Enter a letter: s

There are 1 s's.
You make 8 dollars.

You won 321 dollars!
The phrase was rhodes college.
(Program ends)

Hints

What to turn in

Through Moodle, turn in your code as a file called wheel_yourLastName_yourFirstName.py.

Challenge Problems