View Single Post
  #2 (permalink)  
Old 12-11-2007, 09:55 PM
ShoeNinja's Avatar
ShoeNinja ShoeNinja is offline
Senior Member
 
Join Date: Oct 2007
Posts: 123
ShoeNinja is on a distinguished road
Send a message via AIM to ShoeNinja
Instead of using your whichletter int, you could just use the cntl int that you are using to control your for loop. This should insure that your number is incrementing.

Also, in your if statements
Code:
if (guessedletter.charAt(whichletter) == wordchosen.charAt(whichletter)) { right++; }
I think it should be

Code:
if (guessedletter.charAt(0) == wordchosen.charAt(whichletter)) { right++; }
Unless I am mistanken, the guessedLetter is overwritten each time and only contains a single character correct?
Reply With Quote