Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Can someone right the code for Hangman in java. The game would start off by asking the user if they were playing 1 person or two person hangman. If the user said 1 person then the game would print the spaces for the words just like in hangman and ask the user to guess a letter.

Every time the user guessed incorrectly the game would subtract a life and add that letter to the list of incorrect letters guessed. Each time the user guessed the word right the game would print that letter in its corresponding spot.

For example it would start like this

Are you playing by yourself or two player?

user enters: 1

The game has generated a word for you. It has 8 spaces. Would you like to guess the word, or would you rather guess a letter? Enter word if you want to guess word and enter letter if you want to guess letter. ( It would print out this _ _ _ _ _ _ _ _ as well, this shows the 8 spaces for the letters that user will need to guess and gives them some visualization to go along with the game.)

(The secret word is JAZZLIKE, The game would also ask if the user would like to guess the full word before he guesses a letter each time. If he decides he wants to guess the full word and gets it wrong it would use his turn and take a life away)

user enters: 1

Please only enter single alphabetical letters

user enters: ok

Please only enter single alphabetical letters

user enters: E

The letter E is correct, you have 8 lives remaining. (The game would fill the spaces in the word it was using that had an E) ---> _ _ _ _ _ _ _ E

The code would continue untill the user lost all their lives and the game said game over or until the user had guessed all the letters correctly

Please make sure the code runs without any errors. Thank you

Computer Engineering, Engineering

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

Have any Question?


Related Questions in Computer Engineering

A mail order supplier advertises same-day service on every

A mail order supplier advertises same-day service on every order. Recently, the movement of orders has not gone as planned. The director of customer service has completely redone the method of order handling. The goal of ...

Solve the water-jug puzzle given a 3-litter jug named three

Solve the water-jug puzzle given a 3-litter jug, named Three, and a 4-liter jug, named Four. Initially, Three and Four are empty. Either jug can be filled with water from a tap T, and one can discard water from either ju ...

Explain that when an unauthorized individual gains access

Explain that when an unauthorized individual gains access to the information an organization trying to protect, that act is categorized as a deliberate act of espionage or trespass.

1 the lab manual instructs you to heat camphor at position

1.) The lab manual instructs you to heat camphor at position 2 on the hot plate, which is a moderately low setting. What would be a problem of heating the camphor too quickly? 2.) A mixture of ammonium chloride, sand, an ...

1 a consumer has 300 to spend on goods x and y the market

1. A consumer has $300 to spend on goods X and Y. The market prices of these two goods are Px $15 and Py $5. a. What is the market rate of substitution between goods X and Y? b. Show how the consumer's opportunity set ch ...

For each of the following situations indicate the

For each of the following situations indicate the appropriate distribution to model the random variable, X. 1. Five cards are selected randomly, with replacement from a deck of 52 cards. Let X= the number of kings select ...

Write a program in java to satisfy the following create a

Write a program in Java to satisfy the following : Create a class to store information on Network infrastructure assets. Network Infrastructure Asset may include PCs, Monitors, Switches, Routers, Cables, Access Points et ...

Question sql is often presented a a single database

Question : SQL is often presented a a single database language, but some contend that it is a set of languages. Which is it, why do you say so?, Why is that important for you to understand? Support your answers. The resp ...

What are the typical types of risk faced by a firm explain

What are the typical types of risk faced by a firm? Explain each type of risk in details.

There is a lot of information about how relevant this type

There is a lot of information about how relevant this type of thick clients is still. What are the advantages/disadvantages of these type of connections?

  • 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