Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write a program to support the children's spelling game hangman. Call the program hangman.py. Since there are many versions of hangman, be sure that you implement exactly the following.

The player is to guess the letters in a secret word. Use underscores to display the number of letters in the word. When the player guesses a correct letter, display the word with that letter showing. Correct guesses don't count against the player. Incorrect guesses count, and the player loses on the seventh incorrect guess. Each time the player is asked to enter a letter, the program should display how many guesses they have left and a list of all of the incorrect letters they have guessed. If the player accidentally chooses a letter that has already been guessed, this should not count as a guess. See sample games below.

Your program must contain at least the following functions. (If you want you may use other functions as well.)
· A function that gets a list of words from a file. Call the file wordlist.txt. You must provide your own when you test your program.
· A function that randomly picks a secret word from the list.
· A function that plays the game (i.e., other than main()).
· A function that displays the blanked-out secret word.
· A function that determines whether the letters that have been entered spell the secret word (this returns a boolean).
Part II: User Interface
Once you get your functions working with text, you can add a graphical user interface of your design. The GUI should have the following elements:
· A text area where the word with underscores representing the letters of the word is presented.
· A text area where the letters used are displayed. Optionally you can display the letters not chosen yet. In either case you must identify which role the letters displayed serve.
· A text area indicating the number of guesses the user has remaining.
· An area where the user enters the letter s/he wishes to play.
· When a game completes, a message should appear in the GUI window asking the player whether they want to play another game. The GUI should also provide Yes and No buttons for the player to make a choice.
Once your basic program is working:
The traditional way to play hangman is to draw a figure on a gallows. Another part of the hanged man is added for each incorrect guess. When the figure is complete, the player loses. How you draw the figure is up to you, but it should have exactly seven parts.

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

Innbspmid-2009 rite aid hadnbspccc-ratednbsp20-year bonds

In? mid-2009, Rite Aid had? CCC-rated, 20-year bonds outstanding with a yield to maturity of 17.3%. At the? time, similar maturity Treasuries had a yield of 5%. Suppose the market risk premium is 4% and you believe Rite? ...

Help me define corporate social responsibilityhelp me

Help me define corporate social responsibility. Help me conduct research on a Fortune 500 company and how do you determine just how (or if) the company ranks from a CSR perspective. Help me understand if the findings cha ...

Taskyour task is to implement the hangman game in python

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 b ...

Given the ultra-high abundance of their elements in air it

Given the ultra-high abundance of their elements in air, it is not surprising that these six compounds are common pollutants: NO, NO2, N2O, N2O3, N2O4, N2O5. Calculate the largest ratio of effusion rates that exists betw ...

The standard math library cmath includes a function for

The standard math library cmath includes a function for taking the square root of a number. The heading (prototype) for this function is: double sqrt(double x) Write another function called closer_root that takes two rea ...

A 200g sample of acetylsalicylic acid better known

A 2.00g sample of acetylsalicylic acid, better known asaspirin, is dissolved in 100mL of water and titrated with 0.200mol/L NaOH(aq) to the end point. The volume of base required is 55.5mL. Calculate the molar mass of ac ...

Searching algorithm - which to use for this problemthe

Searching Algorithm - Which to use for this problem? The original problem was: You get a job with a small e-commerce company. b) The customer base has grown to 8,000,000 customers. Jorge now insists that the sorting algo ...

In my sample database i need to use select statements to

In my sample database I need to use SELECT statements to find the following: 1) Find the full names of supervisors together with the total number of employees directly supervised by each one of them. 2) Find the full nam ...

Question 1 identify all the dfd data flow diagram elements

Question: 1. Identify all the DFD (data flow diagram) elements (Shostack, 2014, p.531.). 2. Identify all threat types to each element(Shostack, 2014, p.531.). 3. Identify threats (three or more), one each for data flow, ...

List of fruitspapayakiwifruitzapote List of fruits: papaya kiwifruit zapote blanco

List of fruits: papaya kiwifruit zapote blanco huckleberry banana fig lime xigua vanilla yiessas tamarind umkolo quince apple imbu elderberry juneberry mango strawberry nectarine date cherry orange watermelon grape raspb ...

  • 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