Number wizard nice I have - yoda

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("Namastey Bhaiyo aur Beheno, Let me show you a trick.");
    Debug.Log("How about a magic trick? I'm gonna make this pencil disappear.");
    Debug.Log("HA, Got Em. Its a number game. Quick Maths");
    Debug.Log("Choose a number. Take your time, I've got all day.");
    Debug.Log("Oh, But there is a catch, There's always a catch.");
    Debug.Log("" + max + " is as high as you can get");
    Debug.Log("" + min + " is as low as you can get");
    Debug.Log("every thing in between is 'free real estate'");
    Debug.Log("If its "+ guess +", than smash and obliterate that 'Enter' button");
    Debug.Log("If not then, why are you bullying me");
    Debug.Log("Press 'UP' key to 'pump those rookie numbers up' than" + guess);
    Debug.Log("Press 'DOWN' key to 'lower my expection' than " + guess);
    max = max + 1;
}
// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("Ah, I see. Getting high places my friend.");
        min = guess;
        guess = (max + min) / 2;
        Debug.Log("Is this your number: " +guess);
        Debug.Log("Press 'Enter' to Confirm");
        Debug.Log("If not, Press 'UP' if its higher OR Press 'DOWN' key if its lower");

    }
    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("Damn son, Lower?!!");
        max = guess;
        guess = (max + min) / 2;
        Debug.Log("Is this your number: " + guess);
        Debug.Log("Press 'ENTER' to Confirm");
        Debug.Log("If not, Press 'UP' if its higher OR Press 'DOWN' key if its lower");
    }
    else if (Input.GetKeyDown(KeyCode.Return))
    {
        if (guess < 500)
        {
            Debug.Log("'Congratulation you deserve, Low Numbers you have - YODA'");
        }
        else 
        {
            Debug.Log("congratulations to me, This is Big Brain time");
        }
    }
}

}

1 Like

Yoda :slight_smile:
Do or do not there is no try.

1 Like

Privacy & Terms