Jump to content
Sign in to follow this  
Liquid

hangman help

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...