Uploaded by Abhiram Edala


3 a.
The purpose of the program is to allow a user to experience a hangman game. The purpose is to allow users to possibly
improve their vocabulary and spelling skills by guessing letters to reveal the hidden word.
It demonstrated the generation of a random word for the user to guess, keeping track of the number of incorrect guesses
as the hangman develops a new body part for every incorrect guess. It demonstrated the game starting over when the
start over button was clicked.
The input was the guessing letters of the word, I clicked on the letters that I was guessing and it was inputted into the
program. The output was either an extra body party attached to the hangman when I guessed wrong or my guess was
correct and the correct letters were placed in the word for the user to see.
3 b.
The name of the list being used in the program is wordList.
The data contained in the list is the list of words that are used to be chosen as the word that the user is supposed to
guess. The function to randomly generate words uses the wordList to randomly choose words from for the user to guess.
My code could not have been written, because the word chosen for every round is a random word chosen from that list,
and if there is no list a word cannot be generated. I could do this differently if I chose a different list or made my own list
by writing it out. The purpose of a hangman game is for a word to be chosen for the user to guess. I suppose I could
make it two-player and one use inputs a word for the other user to guess.
3 c.
The first procedure uses the random word generated to display the number of open spaces the word has for the user to
guess. In the game the number of dashes represents the number of letters and when a letter is guessed the letter should
appear instead of the dash in the appropriate spaces.
The procedure works by pulling the random word that was generated and using a loop when substituting the dashes for
the letters so the number of letters corresponds to the number of dashes. Then there is a conditional statement to
substitute the letter back in if guessed by the user correctly.
3 d.
First call:
One call is it sets wordList to a random word.
Second call:
Another call is the var numb being set equal to random number of the list.
3 d.ii.
Condition(s) tested by first call:
It must be part of the list.
Condition(s) tested by second call:
It must correspond to number on list.
Results of the first call:
This sets the specific word of the round to be the random word that was generated.
Results of the second call:
The result is it sets the random number to be used to determine the random word as the random number corresponds to
a certain random word.