public class NumberWizard : MonoBehaviour
{
int max = 1001;
int min = 1;
int guess = 500;
// Use this for initialization
void Start ()
{
Debug.Log("What's up bro! Welcome to Number Wizard.");
Debug.Log("Pick a number dude and don't tell me!");
Debug.Log("Your Highest number you can pick is: " + max);
Debug.Log("Your lowest number is you can pick is: " + min);
Debug.Log("Tell me if your number is higher or lower than " + guess);
Debug.Log("Push Up for Higher, Push Down for Lower, Push Enter if Correct");
//max = max + 1;
}
// Update is called once per frame
void Update ()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
//up arrow was pressed
Debug.Log("The up arrow key was pressed, which means higher");
min = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
//down arrow was pressed
Debug.Log("The down arrow key was pressed, which means lower");
max = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
//return key was pressed
Debug.Log("You hit Enter, which means it is correct!");
}
}
}