Results 1 to 1 of 1
  1. #1
    maddogg2222 is offline Member
    Join Date
    Mar 2013
    Rep Power

    Default hang man problem

    Sorry, I just got it to work.. Thanks anyways..

    Hello, i'm currently working on this hangman project and I cant seem to get it to work. basiacally the main thing that its doing is its only testing the last charactor in the string that its using as the hidden word ive worked for a few days on this and i cant seem to fix it.. can any one see what im doing wrong here?

    Java Code:
    public class hangMan
    public static void main(String[] args)
        boolean stillPlaying = true;
        String word = "hat";
        String wordAsBlanks[] = new String [word.length()];
        CinReader reader = new CinReader();
        for(int i=0;i<word.length();i++)
    	System.out.print(wordAsBlanks[i] = " - ");
        }//end for
    	String userGuess = reader.readString();
    	for(int j = 0;j<word.length();j++)
    	    wordAsBlanks[j] = userGuess;
        }//end for
        }//end do
    }//end main
    Thanks in advance!

    Sorry, I forgot to get rid of that for loop using k as an increasment operator around System.out.println("Guess::"); I just removed it.
    Last edited by maddogg2222; 03-05-2013 at 10:44 PM. Reason: solved

Similar Threads

  1. code gets hang
    By rungtashubham in forum AWT / Swing
    Replies: 4
    Last Post: 03-22-2012, 07:40 PM
  2. What type of hang? and how to fix?
    By joshbrigade in forum New To Java
    Replies: 2
    Last Post: 11-06-2009, 10:40 PM
  3. Read XML from Internet Hang!
    By yupingliew in forum Networking
    Replies: 0
    Last Post: 10-22-2009, 05:56 AM
  4. Applet hang
    By Worlock in forum New To Java
    Replies: 2
    Last Post: 08-10-2009, 06:43 AM
  5. Web application hang without comm.jar
    By chankokchern in forum Java Applets
    Replies: 0
    Last Post: 12-16-2008, 12:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts