Lock, Stock and Two Smoking Wizards

Evenin’ all,

Just my attempt at the Number Wizard through the lens of South-East England. The character is kind of a mish-mash of Fagin and anyone from a Guy Ritchie film; any similarities to persons alive or dead are purely coincidental :wink:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NumberWizard : MonoBehaviour
{
    int maxGuess = 1000;
    int minGuess = 1;
    int guess = 500;

    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("'Ello Guv'nor, don't suppose you fancy a little bit of a flutter?");
        Debug.Log("Come now mate, don't look at me like that! Nothing to worry about, just a little game I like to call Numba Wizard! Catchy ain't it?");
        Debug.Log("The rules is as simple as you like; just pick a number between " + minGuess + " and " + maxGuess + ", and then I'll try to guess wot numba you're thinking of.");
        Debug.Log("The only little, teeny-tiny bit of help I ask for is that you let me know if I need to guess 'igher or lower, savvy?");
        Debug.Log("Righto, let's get crackin'; OK, for my firs' guess I'm goin' to say... " + guess + "?");
        Debug.Log("Push 'Up' for 'igher, 'Down' for lower, and push 'Enter' if I gets it right, right?");
        maxGuess = maxGuess + 1;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            minGuess = guess;
            guess = (maxGuess + minGuess) / 2;
            Debug.Log("It's 'igher? Sod me! Wot about " + guess + "?");
        }
        else if (Input.GetKeyDown(KeyCode.DownArrow))
        {
            maxGuess = guess;
            guess = (maxGuess + minGuess) / 2;
            Debug.Log("It's lower? Come off it mate! Wot about " + guess + "?");
        }
        else if (Input.GetKeyDown(KeyCode.Return))
        {
            Debug.Log("Blinding mate! Fancy anuvva or 'ave you got sumwere to be?");
        }
    }
}

3 Likes

This is awesome!

Privacy & Terms