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

  Compute and conclude the speedup for options

Compute and conclude the speedup for options and decide the option Processor Y should take.

  Explain the difference between hardware and software

Explain the difference between hardware and software. Why should a manager care about software and how software works? What critical organizational and competitive factors can software influence

  Take a demand-paging system

Consider a demand-paging system with the following time-measured utilizations.

  Determine the inner surface temperature of the window

A double-door wood-framed window with glass glazing and metal spacers is being considered for an opening that is 1.2 m high and 1.8 m wide in the wall.

  How to define the Escape Problem

How to  define the Escape Problem

  Describe scenario where employee compromise security policy

Describe a scenario where an employee might compromise a security policy in order to perform a particular job function.

  Develop a full contingency plan for the organization

Develop a full contingency plan for the organization. Include all subordinate functions / sub plans, including BIA, IRP, DRP, and BCP efforts.

  Design a circuit to perform the arbitration process

A multiprocessor system has three processors, each of which can request the bus at any time asynchronously. Each processor has a bus request output, BR,*.

  What are the structural changes that take place in memory

What are structural changes that take place in memory when file is opened twice and its descriptor is replicated? In how many ways can you replicate descriptor?

  Modern microcomputer systems support the multitasking

question 1 modern microcomputer systems support multitasking. applications can be written to spawn multiple threads to

  List three advantage of separating the declaration from body

What is an Ada package? Why are packages important? Ada packages have two parts. List three advantages of separating the declaration from the body.

  There will be projects that require a last-minute push to

there will be projects that require a last-minute push to meet the scheduled deadline. in spite of all of the careful

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