Write the code for hangman in java

Assignment Help Computer Engineering
Reference no: EM132134820

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

Reference no: EM132134820

Questions Cloud

What is the value of his bonus today : The problem to solve is an employee is promised a bonus of $10,000 in five years if he is still with the company at that time. If the opportunity cost
Equal amounts paid at the end of each month : Assume that the salary payments are equal amounts paid at the end of each month. If the interest rate you choose is an 8 percent EAR, what is the size of the se
Calculate the average temperature for the year : Write a program to calculate the average temperature for the year and determine the hottest month of the year.
What is the present value : Please help me study for a test by helping me solve this question. Please show work/formulas used.
Write 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.
What is the apr on a loan from american pride payday : What is the APR on a loan from American Pride Payday Loan Store? You've borrowed $200, with a payoff of $230 due in two weeks.
Showing what work-formulas used : Please help me study for a test by answering this question and showing what work/formulas used. Thanks!
Determining credit policy and an expected level : a) Determining credit policy and an expected level of receivables. b) Deciding among alternative capital projects.
List the instruction and explain if the instruction will : Sometimes during the manufacturing of an integrated circuit, wires-including control signal wires-are accidentally connected to +V or GND.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Describe the stages of the report life cycle and explain

1. what are the stages of the report life cycle and why is it a good business practice to follow one? discuss the

  How to develop a class named stock tracker

How to develop a class named stock tracker that takes the definitions: The constructor "StockTracker ()" creates an initially empty StockTracker object buy(quanity, price) method performs a purchase transaction.

  Explain the page navigation preferences

Before you learn how to use web-authoring software to design, edit, and update web-based content, you need to understand basic concepts regarding.

  Write down the relevant portion of the main function

Write down the relevant portion of the main function of this program to implement the state machine (only the first and the last state).

  What is maximum data rate of the discrete multitone system

A discrete multitone system is using a modulation technique on its subchannels. What is the maximum data rate of the discrete multitone system?

  You have been recently hired by the fortune 500 company to

you have been recently hired by a fortune 500 company to assist in refining the companys enterprise architecture. one

  How much storage would be used by the fft

How much storage would be used by the FFT' if we didn't circumvent the storage-management problem with the perfect shuffle?

  Devise sequence to display total size of all ordinary files

Devise a sequence to display the total size of all ordinary files in the current directory. Calculate from empn.lst the average pay and store it in a variable.

  This is an individually prepared assessment task in this

q. that governments need to do more to safeguard the internet from hacking and cyber warfare because such activity

  Explaining the binary tree

The left spine of the binary tree is a path starting at root and following only left-child pointers down to a leaf. State the expected number of nodes in left spine of an n-node treap. What is the expected number of leaves in an n-node treap?

  How process works in relates to essential definition of dss

How the process works in relates to the essential definition of DSS. Explain the important DSS classifications. Design and implementation apply to your project?

  What are the different classes of ip addresses

What are the different classes of IP addresses? What is the File Transfer Protocol used for? What is the main function of Telnet?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd