Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Word Puzzle Mini-Project De... Short Description Word Puzzle is a game where the player will try guessing a secret word, one letter at a time.

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Word Puzzle Mini-Project De... Short Description Word Puzzle is a game where the player will try guessing a secret word, one letter at a time. The player has a limited number of guesses. Each time the player guesses a letter that is not part of the secret word or a letter that has already been correctly guessed, the player loses a guess; if the player guesses a letter that is part of the secret word and has not been guessed yet, all occurrences of this letter are displayed in the correct position of the secret word, and the player does not lose a guess. The game ends when the player either has guessed all letters in the word correctly (win) or runs out of guesses (lose). Learning Outcomes . Practice basic programming skills Discover new language features[1] Practice interacting with the terminal window, file manager, and WingIDE Learn how to organize your software according to functions Design and write code for a program that implements Word Puzzle as shown in the above screenshots. The program must read the instructions from a file (given below in the Resources section). The word to be guessed should be chosen randomly from a list of words maintained by the program. If the list is replaced by another list with a different number of words, the program should continue to run properly. . Your code must implement the major logical tasks, such as displaying instructions, displaying the current puzzle state, running the main game loop, updating the puzzle state after a guess, and displaying results as user-defined functions. . There should not be any global identifiers in the program except for module names that are imported. All other identifiers must be initialized inside a function. There should not be any function call statement except for call to the main() function in the global namespace of the program . Make sure you are following code quality standards outlined in the Software Quality Tests. Resources To display the instructions for the game use the file wp_instructions.txt. For testing purposes, you may use the following list of words: o 'apple', 'banana', 'watermelon', 'kiwi', 'pineapple', 'mango' Submission Information You are required to submit the solution by the due date provided. For submission purposes, the file with your code should be named: word_puzzle.py user@csvm-Virtualbox:-/Documents/CMPUT174$ python3 Wordpuzzle v3.py I'm thinking of a secret word. Try and guess the word. You can guess one letter at a time. Each time you guess I will show you which letters have been correctly guessed and which letters are still missing. You will have 4 guesses to guess all of the letters. Good luck! The answer so far is Guess a letter (4 guesses remaining): b The answer so far is Guess a letter (3 guesses remaining): e The answer so far is Guess a letter (3 guesses remaining): a The answer so far is a Guess a letter (3 guesses remaining): The answer so far is a Guess a letter (2 guesses remaining): P The answer so far is app Guess a letter (2 guesses remaining): P The answer so far is appe Guess a letter (1 guesses remaining): P The answer so far is appe Not quite, the correct word was apple. Better luck next time Press enter to end the game. Terminal Usergeam-Virtualbos: -/Documents/CMPUT174 Rie Edit View Tomiral Tabs Help user@csvm-Virtualbox:-/Documents/CMPUT174$ python3 Wordpuzzle_v3.py I'm thinking of a secret word. Try and guess the word. You can guess one letter at a time. Each time you guess I will show you which letters have been correctly guessed and which letters are still missing. You will have 4 guesses to guess all of the letters. Good luck! The answer so far is Guess a letter (4 guesses remaining): m The answer so far is Guess a letter (3 guesses remaining): a The answer so far is a Guess a letter (3 guesses remaining): P The answer so far is app Guess a letter (3 guesses remaining): 1 The answer so far is appl Guess a letter (3 guesses remaining): e The answer so far is apple Good job! You found the word apple! Press enter to end the game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

What is paper chromatography?

Answered: 1 week ago

Question

Explain the cost of capital.

Answered: 1 week ago

Question

Define capital structure.

Answered: 1 week ago