Number Wizard Greeting From Russia!

using UnityEngine;

public class NumberWizard : MonoBehaviour
{
private static int max = 1000;
private static int min = 1;
private static int guess = (max + min) / 2;
private static string helloFromRussia = “Привет лунатикам !\nНу ты понимаешь что тут полторы калеки по русски шпрэхает, оставлю как есть :)”;
private static string welcome = “Welcome to NumberWizard, bro !”;
private static string introduction = string.Format(“Here, you need to select number \n You can choose one from {0} to {1}”,min,max);
private static string instruction = string.Format(“So… Tell me, if your number higher or lower than my {0}\nPush Up is Higher\nPush Down is Lower\nPush Enter is Correct”,guess);
private static string gameOn = string.Format(“It’s number higher or lower than {0} ?”, guess);

// Start is called before the first frame update
void Start()
{
    Debug.Log(helloFromRussia);
    Debug.Log(welcome);
    Debug.Log(introduction);
    Debug.Log(instruction);
    Debug.Log(gameOn);
    max += min;
}

// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("down");
        max = guess;
        Debug.Log(guess = (min + guess) / 2);
    }
    else if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("up");
        min = guess;
        Debug.Log(guess = (max + guess) / 2);
    }
    else if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("enter");
    }
    else if (Input.GetKeyDown(KeyCode.Backspace))
    {
        Debug.Log("delete");
    }
}

}

1 Like

Privacy & Terms