Number Wizard from Texas

Here is my code from Number Wizard. I am from Texas so I went with a southern accent. I apologize if I could not spell somethings, I went with my best guess on some of them. lol

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("Well Howdy there, ya'll come in and find ya chair. We gots the Number Wizard ready to go for ya.");
    Debug.Log("Now you just pick a number in ya head, and I will try to guess it.");
    Debug.Log("Ya just got to make sure your number is between " + min + " and " + max + ", if ya'll can count that high.");
    Debug.Log("Press up if ya number is higher than my guess, down if it is lower, and enter if I got it right. No cheating now, ya hear?");
    Debug.Log("We will start this hootinany with " + guess);
    max = max + 1;
}

// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("Oh a litter higher, huh?");
        min = guess;
        guess = (max + min) / 2;
        Debug.Log(guess);
    }

    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("Dagnabit I knew it was lower");
        max = guess;
        guess = (max + min) / 2;
        Debug.Log(guess);
    }

    else if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("Yee haw, told ya I was good at this!");
    }
}

}

Privacy & Terms