Greetings from Ukraine

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NumberWizardConsole : MonoBehaviour
{
    int max = 1000;
    int min = 1;
    int guess = 500;


    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Приветствую to number wizard, йоу!");
        Debug.Log("Dear user, pick a number please :");
        Debug.Log($"Highest number is: {max}");
        Debug.Log($"Lowest number is: {min}");
        Debug.Log($"Tell me if you number higher or lower that my guess than {guess}");
        Debug.Log("Push up = higher , Push down = lower , Push Enter = Correct");

        max += 1;
    }

    // Update is called once per frame
    void Update()
    {   if (Input.GetKeyDown(KeyCode.UpArrow)) 
        { 
            Debug.Log("You just press upArrow key");
            min = guess;
            guess = (max + min) / 2;
            Debug.Log(guess);
        }
        else if (Input.GetKeyDown(KeyCode.DownArrow)) 
        { 
            Debug.Log("You just press downArrow key");
            max = guess;
            guess = (max + min) / 2;
            Debug.Log(guess);
        }
        else if (Input.GetKeyDown(KeyCode.Return)) 
        { 
            Debug.Log("You just press Enter");
        }

    }
}

Privacy & Terms