![Screenshot%20(106)|690x388](upload://3Vl1UWXe1pJyONHXO0eszWNGa6a.png
Or
copy this code for the demo of my game…
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
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("Welcome User");
Debug.Log("Please Pick a number");
Debug.Log("Highest number you can pick is: "+ max);
Debug.Log("Lowest number you can pick is: "+ min);
Debug.Log("If your number is higher or lower than 500");
Debug.Log("Push UP Key = if Higher, Push DOWN key = if Lower, Push Enter key = wait for the result");
max = max + 1;
}
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.UpArrow))
{
min = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if(Input.GetKeyDown(KeyCode.DownArrow))
{
max = guess;
guess = (max + min) / 2;
Debug.Log(guess);
}
else if(Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("I can read your mind");
}
Debug.Log("Thanks For playing");
}
}