Number wizard Greeting from Russia

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 to number wizard

    Debug.Log("Выберете номер");
    //Pick a number

    Debug.Log("Самое большое это: " + max);
    //Highest number is

    Debug.Log("Самое маленькое это: " + min);
    //Lowest number is

    Debug.Log("Сообщите мне если ваш номер больше, или меньше чем 500");
    //Tell me if your number higher or lower that my 500

    Debug.Log("Нажмите вверх если число больше, или вниз если число меньше, или нажмите ввод если число правильное");
    //Pushh up = higher, Push down = lower, Push enter = correct
}

// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("хмм... это число больше");
        //hmm ... the number is higher
        min = guess;
        guess = (max + min) / 2;
        Debug.Log(guess);
    }

    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("хмм... это число меньше");
        //hmm ... the number is lower
        max = guess;
        guess = (max + min) / 2;
        Debug.Log(guess);
    }

    else if (Input.GetKeyDown(KeyCode.Return))
        Debug.Log("Угадал!");
        //guessed!
}

}

Privacy & Terms