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("Welcome to Number Wizard, the number guessing game.");
Debug.Log("First, I'll need you to pick a number between " + min + "and " + max);
Debug.Log("Once you've picked your number, tell me if your number is higher or lower than " + (max + min) / 2);
Debug.Log("Push the up arrow to choose higher, and push the down arrow to choose lower.");
Debug.Log("If I've guess your number correctly, press enter.");
max = max + 1;
}
// Update is called once per frame
void Update ()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Alright, so it was higher.");
min = guess;
guess = (max + min) / 2;
Debug.Log("Is your number now higher or lower than " + guess + "?");
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Ok, so it was lower.");
max = guess;
guess = (max + min) / 2;
Debug.Log("Is your number now higher or lower than " + guess + "?");
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("Yay! I guessed your number correctly.");
}
}
}