Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a word guessing game in Python as follows: 1. The program will ask Player 1 for a word that is five characters or more.

Write a word guessing game in Python as follows:

1. The program will ask Player 1 for a word that is five characters or more.

a. If the word has fewer than 5 characters or if the word contains something other than letters, the program will continue to repormpt until a word 5+ letters is given.

2. The program will then print 50 blank lines - essentially clearin gthe screen.

3. The program will tell Player 2 how many letters make up Player 1's word and will prompt Player 2 for a guess.

4. Player 2 now has 10 guesses to guess the Player 1's word:

a. The program will prompt Player 2 to enter a word to guess:

i. Player 2's guess must be 5 letters or more. If player 2 enters fewer than 5 letters (or their guess contains things that are not letters), an error message will appear and they will be reprompted for a good input. An attempt is NOT taken away if Player 2 provides a guess with fewer than 5 letters or enters a guess that contains things that are not letters.

b. If player 2's guess does not match Player 1's guess (regardless of case), the program tells Player 2 that they were incorrect.

i. The program tells Player 2 that they did not guess correctly.

ii. The program takes a guess away and tells Player 2 how many more guesses that they have remaining.

5. The game ends if Player 2 guesses Player 1's word OR if all 10 guesses are used:

a. If player 2 guessed Player 1's word (regardless of case) in the 10 attempts:

i. A "congratulations" message is printed to the screen

ii. Player 1's secret word is shown.

b. If all 10 guesses are used before Player 2 guesses the word, Player 2 has lost:

i. A "sorry" message is printed to the screen.

ii. Player 1's secret word is revealed.

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

5. Our efficiency focus eliminates free time for fresh thinking.

Answered: 1 week ago