public class NumberWizard : MonoBehaviour
{
int max = 1000;
int min = 1;
int guess = 500;
// Start is called before the first frame update
void Start()
{
Debug.Log("Hola, Welcome to Number Wizard Parcero, Diviertete");
Debug.Log("Please think a Number, but keep it in your mind, maybe I can hear you");
Debug.Log("Remember the highest number that you can pick is: " + max);
Debug.Log("The lowest number that you can pick is: " + min);
Debug.Log("Now tell me, did I read your mind?, your number is: " + guess);
Debug.Log("Push Up = If your number is higher, Push Down = If your number is Lower, Push Enter = If I am Correct");
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("So your number is Higher, let me think");
min = guess;
guess = (min + max) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("So your number is Lower, I know that trick");
max = guess;
guess = (min + max) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("I told you, I am a Magician");
}
}
}