Very happy to start delving deeper into C# and game development and design, been on my mind to do for far too long, so finally getting to it!
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("Heya, come on in! Welcome to Number Wizard, where I will unerringly guess your number! " +
"(It might take me a few tries, but hey, it'll work! Trust me!");
Debug.Log("I want you to choose a number between the lowest and highest number...");
Debug.Log("The lowest number is " + min);
Debug.Log("The highest number is " + max);
Debug.Log("Tell me if your number is higher or lower than " + guess);
Debug.Log("If your number is higher - push the Up key, if it is lower - push the Down key, if I'm right - press Enter!");
max = max + 1;
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Ah! Up we goooooo!");
min = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Whups, need to take a step down here...");
max = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("See! I told you that you could trust me!");
}
}
}