# Why say Unity 1 and 0 is 1 and 10 too?

Does anybody know how Unity says 1 + 0 = 10?
I have a simple math question with an input field which include the question:" 1 + 0 = ?"
If the result is right then it will be return right and if it false then it returns false.
Now when I input 1 in the textField it return right. But when I write 10 it returns right too.
P.S. I change the string value from the textField to an integer with “int.Parse(inputField1.text);”.
Here is my whole Script:

``````using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class SimpleAddition : MonoBehaviour {

public Text number1;
public Text number2;
public Text resultOfNumber1AndNumber2;
public InputField inputField1;
public int value1;
public int value2;
public int resultValue;
public int ownResultValue;
public bool right = false;
public GameObject right;   //GamObject with a Text "right"
public GameObject false;

void Start()
{
wert1 = Random.Range(0, 5);
wert2 = Random.Range(0, 5);
number1.text = value1.ToString();
number2.text = value2.ToString();
result.text = "???";
}

public int Addition(int number1, int number2)
{
int  summe = number1 + number2;
return summe;
}

void Update()
{
ownResultValue = int.Parse(inputField1.text);
if (resultValue== ownResultValue)
right = true;
}

public void CheckResult()
{
if (right)
{
right.SetActive(true);
false.SetActive(false);
}

if (!right)
{
false.SetActive(true);
right.SetActive(false);
}
}
}
``````

The method “CheckResult” is called from a button when you are done.

Your problem is that you check the input every frame and once it was right it will stay right since you set “right” to true but never back to false.

It’s pointless to check the value every frame when you actually have a CheckResult button.

Just do:

``````public void CheckResult()
{
ownResultValue = int.Parse(inputField1.text);
if (resultValue== ownResultValue)
{
right.SetActive(true);
false.SetActive(false);
}
else
{
false.SetActive(true);
right.SetActive(false);
}
}
``````

Instead of the if-else you could also simply do this since we only work with bool values:

``````public void CheckResult()
{
ownResultValue = int.Parse(inputField1.text);
bool correct = (resultValue== ownResultValue);
right.SetActive(correct);
false.SetActive(!correct);
}
``````

In addition i should mention that your code usually shouldn’t compile at all. You declared two variables named “right” (a bool and a GameObject). That’s not possible.