using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizard : MonoBehaviour {
int max = 1000;
int min = 1;
int guess = 500;
// Use this for initialization
void Start () {
Debug.Log("ozi ozi ozi, oi oi oi hello to the number wizard");
Debug.Log("Pick a number please");
Debug.Log("max number is: " + max);
Debug.Log("min number is: " + min);
Debug.Log("judge if your number is bigger or smaller than " + guess);
Debug.Log("Push Up = Higher, Push Down = Lower, Push Enter = Correct");
max = max + 1;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Up key was pressed");
min = guess; //stores 500
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Down key was pressed");
max = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("You hit enter");
}
}
}
// if (Input.GetKeyDown(KeyCode.Space))
// {
// Debug.Log(“space key was pressed”);
// }