The Number Wizard

I was about to make a long dialogue that might make player feel bored from reading a lot :sweat_smile:. and unfortunatly I canโ€™t make it in Arabic. if I wrote it in English letters that when you read it you will be like reading Arabic but not understanding anything, so what is the point will be from The Number Wizard :joy:. I have made some changes and here it is.

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 and runs once
void Start()
{
    Debug.Log("Do you like numbers?");
    Debug.Log("Then Welcome to the Number Wizard! ha ha ha (Evil laugh)");
    Debug.Log("Pick a number within " + min + " and " + max);
    Debug.Log("Wait..wait...don't tell me what it is.");
    Debug.Log("now if your number is Higher than my guess, press up");
    Debug.Log("and if your number is lower than my guess, press down");
    Debug.Log("if I am right don't cheat me! just press Enter.");
    Debug.Log("am I clear amigo, let's start");
    Debug.Log("woooooo (Magic)... is your number " + guess);

    max = max + 1;
}

// Update is called once per frame
void Update()
{
    //the if statement checks if the player pressed the up arrow
    //and print out the sentence in the unity console
    if (Input.GetKeyDown(KeyCode.UpArrow)){ 
        min = guess;
        guess = (max + min) / 2;
        Debug.Log("Is your number higher than " + guess + "?");
    }
    else if(Input.GetKeyDown(KeyCode.DownArrow)){
        max = guess;
        guess = (max + min) / 2;
        Debug.Log("Is your number Lower than " + guess + "?");
    }
    else if(Input.GetKeyDown(KeyCode.Return)){
        Debug.Log("I got it !!! orayyyy");
    }
}

}

1 Like

Phenomenal job with your Number Wizard!

1 Like

Thank you @Kevin-Brandon :smiley:

1 Like

Anytime :grinning_face_with_smiling_eyes:

Privacy & Terms