All pastes #718626 Raw Edit

Untitled

public text v1 · immutable
#718626 ·published 2007-09-28 16:04 UTC
rendered paste body
    public boolean checkGuess()
    {
        for( int index = 0; index < wordArray.length; index++ )
        {
            if( (charGuess == wordArray[index]) && (index == 0) || (charGuess != guessedLetters[index]) )
            {
                correctGuess = true;
                correctChar = charGuess;
                for( int i = 0; index < wordArray.length; i++ )
                {
                    if( wordArray[i] == correctChar )
                    {
                        System.out.print(" " + correctChar + " ");
                    }
                    else
                    {
                        System.out.print(" _ ");
                    }
                }
            }
            else
            {
                correctGuess = false;
            }
            guessedLetters[index] = guessedLetters[charGuess];
        }
        return correctGuess;
    }
}