This my Code so for Number Wizzard

public class NumberWizard : MonoBehaviour
{
    int max = 1000;
    int low = 1;
    int guess = 500;


    // Start is called before the first frame update
    void Start()
    {
        
        
        Debug.Log("Welcome to the number wizard!");
        Debug.Log("choose a number between 1 or 1000. don't tell me the number!");
        Debug.Log("It is realy easy to just pick higer or lower!");
        Debug.Log("The highest number you can pick is: " + max);
        Debug.Log("the lowest number you is pick is: " + low);
        Debug.Log("tell me if your number is higer or lower than:" + guess);
        Debug.Log("Push up = Higher, Push down = lower, Push Enter = Correct");
        max = max + 1;

    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            Debug.Log("Up to guess if it is higer: "  + guess);
            low = guess;
            guess = (max + low) / 2;
            Debug.Log(guess);
        }

       else if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            max = guess;
            guess = (max + low) / 2;
            Debug.Log(guess);

            Debug.Log("Down to guess if it is lower: " + guess);
        }

        else if (Input.GetKeyDown(KeyCode.Return))
        {
            Debug.Log("Return key was pressed.");
        }

    }

Privacy & Terms