public class NumberWizard : MonoBehaviour
{
// Start is called before the first frame update
int max = 1000;
int min = 1;
int guess = 500;
void Start()
{
Debug.Log("Kumusta! Welcome to Number Wizard!");
Debug.Log("Please Think of a Number between " + min + " and " + max + "!");
Debug.Log("I will guess it and you tell me if it's higher or lower than your guess!");
Debug.Log("Push Up = Higher, Push Down = Lower, Push Enter = Correct!");
Debug.Log("Let's start! Is your number higher or lower than " + guess + "?");
max = max + 1;
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Up Arrow key was pressed.");
min = guess;
guess = (max + min) / 2;
Debug.Log(guess + "?");
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Down Arrow Key was pressed.");
max = guess;
guess = (max + min) / 2;
Debug.Log(guess + "?");
}
else if (Input.GetKeyUp(KeyCode.Return))
{
Debug.Log("Return key was released.");
}
}
}