using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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("What's poppin! Welcome to the Number Wizard - time to play!");
Debug.Log("Pick a number - any number between " + min + "-" + max + ". Let's 'av it!");
Debug.Log("Tell me if your number is higher or lower than " + guess);
Debug.Log("Press the UP key for higher, press the DOWN key for lower, Press Enter if it's correct");
max += 1;
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Higher? Okay!");
min = guess;
guess = (max + min) / 2;
Debug.Log("Is your number higher or lower than " + guess + "?");
}
else if(Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Lower! I see...");
max = guess;
guess = (max + min) / 2;
Debug.Log("Is your number higher or lower than " + guess + "?");
}
else if(Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("BANG! Pure precision from the Number Wizard again!");
}
}
}