Jump to content

hangman help


Liquid

Recommended Posts

I have to build a private hangman game. Im trying to break it up into parts and the one im stuck on is taking the letter, that the second user entered as his guess and comparing it to the first users secret word string. what i have right now is all jumbled so wont make much sense.Basicly how would you go about looking in a string for a character and then if its found implement a string the draws the letter in.

Link to comment
Share on other sites

System.out.println(secret.indexOf(guess));can you take the indexOf of a string with a string.in this case secret is a sting entered by the user and guess is a letter entered by a second user. i want to compare the letter to the word entered and then either print the next stage of the hangman or print the location of the letter in the word

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...