Guess the word game in Java
<p>i have a problem writing guess the word game java code .
i'll show you my current code and till you the problem .</p>

<pre><code>import java.util.Scanner;

class Q
{
    public static void main(String argss[])
    {
        String strs[] = { "kareem", "java", "izz", "tamtam", "anas" };
        Scanner input = new Scanner(System.in);
        int index = ((int) (Math.random() * 5));
        int points = 50;
        String c;
        boolean result = false;
        boolean finalResult = false;
        boolean tempResult = false;

        String word = strs[index];
        System.out.println(
                "\t *** Enter a character and guess the world*** \n\t ***You will loose if your points become 0 *** \n ");
        System.out.println(stars(word));
        System.out.println("Your points: " + points);
        System.out.print("Enter and guess a character! ");

        String temp = stars(word);
        String oldTemp = temp;

        c = input.next();
        while (points &gt; 0)
        {

            for (int i = 0; i &lt; word.length(); i++)
            {
                result = (word.charAt(i) + "").equals(c);
                if (result == true)
                {
                    temp = toChar(i, temp, c);
                }

            }

            finalResult = temp.equals(word);
            tempResult = temp.equals(oldTemp);
            System.out.println(temp);
            if (finalResult == true)
            {
                System.out.println("\n \n YOU HAVE GUESSED THE WORLD,YOU WON ! ");
                break;
            }
            if (tempResult == true)
            {
                points = points - 5;
                System.out.println("False and now your points are " + points);
            }

            else if (tempResult == false)
            {
                System.out.println("True and now your points are " + points);

            }
            if (points &lt;= 0)
            {
                System.out.println("\n\n*********************\n* Sorry , you loose *\n*********************  ");
                break;
            }
            System.out.print("Guess another time,enter a character: ");
            c = input.next();
        }

    }

    public static String stars(String word)
    {
        String temp = "";
        for (int i = 0; i &lt; word.length(); i++)
            temp = temp + "*";
        return temp;
    }

    public static String toChar(int index, String temp, String c)
    {
        char[] tempChar = temp.toCharArray();
        char s = c.charAt(0);
        tempChar[index] = s;
        temp = String.valueOf(tempChar);
        return temp;
    }
}
</code></pre>

<p>now as you can see in line number 39 , i have a little problem here because when its false it'll be no longer right .
do you know another way to compare if the entry is right or not ? </p>