using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizard : MonoBehaviour
{
int max = 1000;
int min = 1;
int guess;
// Start is called before the first frame update
void Start()
{
guess = (max + min) / 2;
Debug.Log("Heei! Bun venit la magicianul numerelor!");
Debug.Log("Pick a number, don't tell me what it is...");
Debug.Log("The highest number you can choose is: "+ max);
Debug.Log("The lowest number you can choose is: "+ min);
Debug.Log("Tell me if your number is higher or lower than 500");
Debug.Log("Push Up = higher, Push Down = Lower, Push Enter = Correct");
max = max + 1;
}
// Update is called once per frame
void Update()
{
guess = (max + min) / 2;
if (Input.GetKeyDown(KeyCode.UpArrow))
{
min = guess;
guess = (max + min) / 2;
Debug.Log("your guess is higher...");
Debug.Log("hmm...your number is: " + guess);
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
max = guess;
guess = (max + min) / 2;
Debug.Log("your guess is lower...");
Debug.Log("hmmm...your number is" + guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("Stiaam ca asta e!!");
}
}
}