
using UnityEngine;
using System.Collections;
public class NumberWizard : MonoBehaviour {
int max = 1000;
int min = 1;
int guess;
// Use this for initialization
void Start () {
guess = (max + min) / 2;
print ("Welcome to NumberWizard");
print ("Pick a number in your head, but don't tell me");
print ("The highest number you can pick is " + max);
print ("The lowest number you can pick is " + min);
print ("up = higher down = lower enter = correct");
print ("My guess is " + guess);
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown (KeyCode.UpArrow)) {
//print ("You press the up arrow, good job");
min=guess;
guess = (max + min) / 2;
print("Is your number " + guess);
}
if (Input.GetKeyDown (KeyCode.DownArrow)) {
//print ("You press the down arrow, good job");
max = guess;
guess = (max + min) / 2;
print ("Is your number " + guess);
}
if (Input.GetKeyDown(KeyCode.Return)){
//print ("You press the down arrow, good job");
print ("I guess your number is " + guess);
}
}
}