int max = 1000;
int min = 1;
int guess = 500;
// Start is called before the first frame update
void Start()
{
Debug.Log("Well, hey there! You've arrived! Ready to have your number guessed?!");
Debug.Log("Now, secretly pick any number. Remember IN SECRET, TELL NO ONE!!!");
Debug.Log("We're working with the highest number of " + max);
Debug.Log("And you can go no lower than " + min);
Debug.Log("Tell me if your number is higher or lower than " + guess);
Debug.Log("You can do this with the up and down arrow keys. Don't lie!!!");
Debug.Log("AND ... when your number is correctly guessed ... hit ENTER!");
max = max + 1;
}
// Update is called once per frame
void Update()
{
//Detect Up arrow key pressed
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("More?!! Really?? How about ... ");
min = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
//Detect Down arrow key pressed
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Less, fine okay, what about ... ");
max = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
//Detect Return/Enter key pressed
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("Woohoo! Got it! Yay! Cool number btw");
}