using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizard : MonoBehaviour
{
int maximumguess = 1000,
minimumguess = 1,
guess = 500;
// Start is called before the first frame update
void Start()
{
Debug.Log("The wizard of numbers awaits!"); //Works like print but better coding habit
Debug.Log("Please Pick a Number, do not tell me what it is.");
Debug.Log("The Highest Number is " + maximumguess);
Debug.Log("The Lowest Number is " + minimumguess);
Debug.Log("Tell me if your number is higher or lower than " + guess);
Debug.Log("Push Up = Higher, Down = Lower, Enter = Correct.");
maximumguess = maximumguess + 1;
}
// Update is called once per frame
void Update()
{
//Detect when the up arrow key is pressed down
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Your number is higher than " + guess);
minimumguess = guess;
guess = (minimumguess + maximumguess) / 2;
Debug.Log("Is your number " + guess + "?");
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Your number is lower than " + guess);
maximumguess = guess;
guess = (minimumguess + maximumguess) / 2;
Debug.Log("Is your number " + guess + "?");
}
else if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
{
Debug.Log("The Wizard of Numbers KNOWS ALL.");
}
else if (Input.GetKeyDown(KeyCode.Space))
{
Debug.Log("Space is not a creative button.");
}
}
}