Bem Vindos Number Wizard

int max = 1000;
int min = 1;
int guess = 500;

// Use this for initialization
void Start () {

    Debug.Log("Bem Vindos!! - From Brazil");
    Debug.Log("Welcome Poor Souls, here we are gonna play a little game that is going to decide If you Live or Die - IT´S SHOW TIME!!!!  - Just kidding or not haha");
    Debug.Log("Choose whatever number you want and I'´ll try to guess what is and If i hit the correct number you LOSE!!!");
    Debug.Log("The highest number you can pick is : " + max);
    Debug.Log("The Lowest number you can pick is : " + min);
    Debug.Log("Tell me if you numer is higher 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 Arrow key was pressed.");
        min = guess;
        guess = (min + max) / 2;
        Debug.Log(guess);
    }
    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("Down Arrow key was pressed.");
        max = guess;
        guess = (min + max) / 2;
        Debug.Log(guess);
    }
    else if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("Enter key was pressed");
    }

Privacy & Terms