Gabriel Boudreau Create Task - TheRadRabbidRabbit/Team-Lovelace GitHub Wiki
Requirements
- Final Program code which must include
- User input
- At least one use of a list or collection
- At least one procedure
- At least one algorithm
- Calls to procedure
- Video containing the running of your code and it's functionality
- Written responses to performance
Planning
- Build initial call procedure and start functionality
- Create temporary list to show word and elements in it
- Add in tries value to count down attempts at guessing word
- Create while functionality to keep procedure running until an end Boolean is set as true
- Print aspects of the guessed letters list
- Build display menu to see letters as they are inputted
- Add append aspects to grow guessed letters list and word completion list
- Add winning and losing values to finish game as winner or loser
Code

Explanation
3a
-
i: The purpose of the program is to simulate the game hangman, in which you can guess individual letters given a set amount of tries until you either run out of tried or guess the word. This is done in order to test our skill in coding and knowledge of python. You can input letters into the simulation and the word is randomized.
-
ii: The video presented shows the functionality of the program on both the site and in the replit terminal. A random word is selected from the list called "words". From here a while loop keeps the program functional as a user input is requested for each individual letter. As you proceed a list appears showing all letters that have been used thus far, your progress towards the word, and the amount of tries remaining.
-
iii: The input of the program is the guess letter or "guess". This guess is then compared to the randomly selected word as well as the list of already used letters in order to give an output telling you the letter has already been guessed, the letter is not in the word, or that the letter is in the word as well as it's position.
3b
-
i: Data is stored in the list words. This list of words is used when the program randomly selects one of the words using word = random.choice(words). The list of words is: words = ["constellation","recruit","arch","whisper", "cottage", "intellegence", "budge", "finish", "new", "village", "photocopy", "beg", "improvement", "sofa", "banana", "carrot", "ruby", "squirrel", "strawberry"]
-
ii: This is answered in part i. This list is called upon using: word = random.choice(words).
-
iii: The name of the list being used is "words".
-
iv: This list is a dictionary that represents the possible words that can be used for the game. This helps to create randomization and diversity for the game.
-
v: The list can easily be called upon towards the start of the program. It can easily be expanded for further use simply by adding more or less words to the list and it improves the functionality of the code as each word does not need an individual variable to be randomly called upon.
3c
-
i/ii: Whole program was coded individually:

-
iii: The primary procedure "game" contains the entirety of game segment. It contains all code excluding the list of words and the start functionality, which is what calls on the procedure initially.
-
iv: The code starts by randomly selecting a word from the list, stating that the game's outcome is not determined, and creating a new list with the displayed letters, the used letters, and a variable containing the amount of tries remaining. Afterwards a while loop is called upon using iteration through a user input and providing an output based on the correlation of the user input to the word selected. All guesses are stored in the new list "guessedletters" which is repetitively shown to the user as a reminder, as well as the display on the completion of the word so far through the variable "word_completion_display". This is repeated until the user is either out of tries, in which the end and lost boolean will be set to True and the game will give you a loss message, or the user will successfully guess all letters in the word and have the win and end boolean set to True triggering the winning message.
3d
First call: Call to procedure in start function. You can guess the first letter of the game. If you get it incorrect, then the letter is added to the list of used letters, and you can guess again. Second call: Call to display in order to display the word progress on the screen. You can guess another letter, if you get it correct, then the letter is added to the list of guessed letters, and is added to the display.