Still working on my hangman program from yesterday (Thanks Shoeninja for help!)
I re-did a bunch of it to include global variables and such
here is the method I am still having problems with:
BuildWord is a global string variable with the value " " (8 spaces). the loop compares your 1-char guess with all 8 characters of a randomly chosen 8-letter word. What buildword does is keep track of the word you've guessed so far. So say the word is aardvark, and you guess "a" I want buildword set to "aa a ", using cnt from the for loop to replace the appropriate spaces.
"String tempword = BuildWord.charAt(cnt)" is where I am getting the cannot convert from char to string error.
public static void compare ()
{//BEGIN COMPARISON
BuildWord=" ";
for (int cnt=0;cnt <=7; cnt++)
{//begin for
String templetter = guessedletter;
String tempword = BuildWord.charAt(cnt)
//compares your one character guess to every character of the wordchosen
if (guessedletter.charAt(0) == wordchosen.charAt(cnt))
{
tempword = templetter;
}
else
wrongt++;
}//end for
thanks,
-Sondra