Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Task

Your task is to implement the Hangman game in Python. Before implementing the game, please play the game on the website mentioned above. It will help you understand the project.

Project Specifications:

1) Output a brief description of the game of hangman and how to play.

2) Ask the user to enter the word or phrase that will be guessed (have a friend enter the phrase for you if you want to be surprised). Error check: repeatedly ask for a word or phrase until the input is letters and spaces.

3) Output the appropriate number of dashes and spaces to represent the phrase. Dashes are placeholders for letters.

4) Continuously read guesses of a letter from the user and replace the corresponding dashes if the letter is in the word (replace all occurrences, upper and lower case, of the letter), otherwise report that the user has made an incorrect guess.

Error check: only accept letters and spaces. An incorrect guess is counted as a guess, but a guess that is not letters and spaces is not counted as a guess. If a guess is more than one letter, it is assumed to be a guess of the whole phrase: if the match is perfect (independent of case), the game is won; if not, the game is over as a loss.

5) Each turn you will display the phrase as dashes but with any already-guessed letters filled in, as well as which letters have been incorrectly guessed so far and how many guesses the user has remaining.

Case of original input must be preserved, e.g. an upper-case letter in word/phrase must always be displayed in upper case even if the user guessed using a lower-case letter.

6) Your program should allow the user to make a total of k=6 guesses. After the 6th guess, the game is either won with a correct guess or the game ends as a loss.

7) One run of the program plays the game once. Do not have a loop to restart the game.

Assignment Notes:

1. Simplify: a. Leave error checking to last.

b. Write your first version to handle a single word (not a phrase of multiple words).

2. To clarify the project specifications, sample output is appended to the end of this document.

3. You may not use advanced data structures such as lists, sets, or dictionaries.

4. Items 1-7 of the Coding Standard will be enforced for this project.

5. Review the syllabus with respect to collaboration. What you hand in must be your own work.

Among other things, note this one: "If you show your code to another student, you are almost guaranteed a zero because most novice programmers will not be able to think of another way to do it and end up copying your code or sharing it with someone else who copies it."

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93137851

Have any Question?


Related Questions in Computer Engineering

Question suppose you are buying stamps to put on a package

Question : Suppose you are buying stamps to put on a package at the post office. The postage required to send the package is N dollars. You can buy $1, $7, and $10 stamps. You want to find the minimum number of stamps re ...

1 explain how the following industries should adapt

1. Explain how the following industries should adapt their businesses to the ever expanding use of social networks and mobile computing (smart phones, tablet computers, etc.): 1) Media and Entertainment, 2) Department st ...

Can someone design a small program for me in java that do

Can someone design a small program for me in Java that do the following: Implement at least four classes (showing inheritance) with suitable constructors and methods to set/retrieve values of from the properties. Try to ...

Describe an ethical conundrum found in a magazine or

Describe an ethical conundrum found in a magazine or newspaper article, and please give your own thoughts. Give good citations, of course.

Two manufacturing firms are located on the banks of the

Two manufacturing firms are located on the banks of the Crimea River. Riditna Paper withdraws river water for use in its paper mill, and returns it, along with waste effluent, back into the river. (Effluent is a co-produ ...

Switches are an integral part of networks they are the

Switches are an integral part of networks. They are the devices you utilize for host connectivity to the network. Please identify and discuss an attack that takes advantage of a weakness in switches.

Benefits of abating emission mb500-20acost of abating

Benefits of abating emission: MB=500-20A Cost of abating emission: MC=200+5A What are the marginal benefit and marginal cost of abatement at socially efficient level of abatement? What is the net social benefit at the ef ...

1 write code in the method linearsearch in

1. Write code in the method linearSearch() in "SearchMethods"class which finds the element in an array using linear search approach and returns its index to the calling main method, otherwise it returns -1. 2. Write code ...

Question 1 write data to the file the program should ask

Question : 1. Write data to the file The program should ask user for an integer and write that integer to a file. Save the program as Part1.cpp. 2. Read the data from the file The program should read the data from the fi ...

Suppose a coworker approaches you and asks what an ethical

Suppose a coworker approaches you and asks what an ethical hacker does. She does not understand the role that an ethical hacker plays in the security industry and assumes that such a hacker intentionally causes damage. E ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As