Project 4: Spelling Words

Academic Integrity

Academic integrity means that you submit for a grade work that is entirely yours. The following figures indicate where and who can help:

Due Date

See the calendar for due date.

Objectives:

Description

Provide a simple game to practice spelling words. Given a list of spelling words, randomly choose one of them. Randomly reveal letters until the user correctly guesses the right word. For each guess, only reveal another letter after a valid spelling word is entered.

Requirements

Write a Python 3 script that has a main function. Also, store the spelling words in a list (with more than one element). Display the number of elements in that list. Additionally, store the word that is being revealed in a list as well. The mystery word must by randomly chosen. (One way to to that is to look at the functions in the Random module that take a list.) Additionally, the letter to reveal in the mystery word must be randomly chosen.

Include comments at the top of the file with a description of the script, your name and the date. Additionally, include a descriptive comment before each function and each major section of your code. Describe in English (not code) what the function or section does. Be sure to include any assumptions. Write the comments for another software developer to read, meaning one that already knows Python.

Example 1A (user input in bold face blue, required elements for autograded are underlined)

Here's an example of when the user correctly guessed the mystery word before all of the letters were revealed:
Let's practice some spelling words!

Please enter all the spelling words (separated by spaces): wait weight heard herd days daze heel heal peak peek sent cent scent feet feat vain vane vein miner minor
Thank you for entering 20 words

Here's the mystery word: --a--
Please enter your guess: wait
Here's the mystery word: -ea--
Please enter your guess: weight
Here's the mystery word: -ear-
Please enter your guess: heard
Good job!
You guessed heard in just 3 guesses!

Example 1B (user input in bold face blue, required elements for autograded are underlined)

Here's an example of when the user did not correctly guess the mystery word before all of the letters were revealed. Also notice that the same list of spelling words as in Example 1A was given, but a different mystery word was chosen this time:
Let's practice some spelling words!

Please enter all the spelling words (separated by spaces): wait weight heard herd days daze heel heal peak peek sent cent scent feet feat vain vane vein miner minor
Thank you for entering 20 words

Here's the mystery word: ---o-
Please enter your guess: wait
Here's the mystery word: -i-o-
Please enter your guess: weight
Here's the mystery word: -i-or
Please enter your guess: heard
Here's the mystery word: mi-or
Please enter your guess: herd
Thanks for playing.
The word was minor. Let's play again!

Example 2 (user input in bold face blue, required elements for autograded are underlined)

Here's an example with incorrect input:
Let's practice some spelling words!

Please enter all the spelling words (separated by spaces): supercalifragilisticexpialidocious pneumonoultramicroscopicsilicovolcanoconiosis pseudopseudohypoparathyroidism
Thank you for entering 3 words

Here's the mystery word: -----------------------r------
Please enter your guess: python
Sorry, python is not a spelling word
Please enter your guess: supercalifragilisticexpialidocious
Here's the mystery word: -----------------------r-i----
Please enter your guess: rocks
Sorry, rocks is not a spelling word
Please enter your guess: please
Sorry, please is not a spelling word
Please enter your guess: supercalifragilisticexpialidocious
Here's the mystery word: -----------------a-----r-i----
Please enter your guess: a
Sorry, a is not a spelling word
Please enter your guess: I
Sorry, I is not a spelling word
Please enter your guess: hi
Sorry, hi is not a spelling word
Please enter your guess: supercalifragilisticexpialidocious
Here's the mystery word: -----------o-----a-----r-i----
Please enter your guess: pneumonoultramicroscopicsilicovolcanoconiosis
Here's the mystery word: -------s---o-----a-----r-i----
Please enter your guess: pseudopseudohypoparathyroidism
Good job!
You guessed pseudopseudohypoparathyroidism in just 5 guesses!

Rubric:

Points       Item
----------   --------------------------------------------------------------
_____ / 10   Comments before each function and major section of code (written for another software developer; not too many comments and not too few)
_____ / 25   Spelling words in a list and mystery word letters in a list
_____ / 25   Input validation (only spelling words accepted)
_____ / 10   Random spelling word and random letter revealed each iteration
_____ /  4   Submitted 1+ days early (bonus)
_____ /  2   Completed rubric (estimates for each line including hours spent)

_____ / 72   Total


_____  Approximate number of hours spent

I, (REPLACE WITH YOUR FULL NAME), affirm that the code that I submitted is my own work and that I did not receive help that was not authorized by the instructor.

Submission

Submit your project4.py and your rubric-project4.txt to the appropriate Assignment tab/folder in CougarVIEW.

Bonus

  1. Submit your project at least 24 hours before the due time and earn at least 90% of points.

Notes

  1. Before writing any code, write the major steps as comments. Then, iteratively go through and implement each step. For example, start with welcoming the user. Then, get the spelling words from the user and store it in a list. Verify that it works. Then, work on the next step.
  2. If you would prefer to start by revealing 0 letters of the mystery word, then that is also completely acceptable.

Hints

  1. Here are the general steps for input validation:
    # prompt the user and get input from the user
    # while not( valid_input_expression ):	    
        # display an error message
        # prompt the user and get input from the user
    or
    # prompt the user and get input from the user
    # while invalid_input_expression:	    
        # display an error message
        # prompt the user and get input from the user
    where valid_input_expression is a boolean expression that is True if the input is valid and False otherwise and invalid_input_expression is a boolean expression that is True if the input is invalid and False otherwise.

Challenges (worth 0 extra points)

  1. Extend the script to play multiple rounds.
  2. Extend the script to play multiple rounds, iterating through each of the spelling words in a random (shuffled) order.