Cookie Monster Version
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("Hello There. You look tired how many Cookies can you eat? ");
Debug.Log("Tell me and I will bake them for you ?");
Debug.Log("I cant belive you can but can you eat " + max);
Debug.Log("You must be surely eat at least " + min);
Debug.Log("You sure can eat :" + guess+" Cookies");
Debug.Log("Push UP = Higher, Push Down = LOWER, Push Enter = Deal Done");
max = max + 1;
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("No wonder you are this fat. Can you eat"+guess+"cookies." );
min = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("How can you eat "+guess+" cookies !!!");
max = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("Ok Let me bake those "+guess+" Cookies !!!");
}
}
}