The second Laba diena from LT

Greetings here!
I would like to share some of my creativity putted on script.
It is not incredible, but it may simple things aspire you.
For me it was awesome to script something awesome, it seems you create a game like in Casino or similiar to that.
Now I leave a code for ya leaded by this course.

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("Sveiki, have a great call to the small and maybe tidiest number wizard roller");
        Debug.Log("---> Pick a number, the easy you can think of <---");
        Debug.Log("/*/ Highest number you can try hard on is: " + max);
        Debug.Log("\\*\\ Lowest number you can get easy on is: " + min);
        Debug.Log("\\*/ Tell the roller if your number guess is higher or lower than " + guess);
        Debug.Log("Here some controls: Higher [Up], Lower [Down], Correct [Enter]");
        max++;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.UpArrow))
        {
            Debug.Log("-> You have pressed Up Arrow key");
            min = guess;
            guess = (max + min) / 2;
            Debug.Log("** It means your guess is: " + guess);
            Debug.Log("** Try another guess or maybe it's your final decision");
        }
        else if(Input.GetKeyDown(KeyCode.DownArrow))
        {
            Debug.Log("-> You have pressed Down Arrow key");
            max = guess;
            guess = (max + min) / 2;
            Debug.Log("** It means your guess is: " + guess);
            Debug.Log("** Try another guess or maybe it's your final decision");
        }
        else if(Input.GetKeyDown(KeyCode.Return))
        {
            Debug.Log("-> You have pressed Enter");
            Debug.Log("** You have rolled the slider");
            Debug.Log("** Let's leave to machine a check, does your guess has a decisive fortune...");
        }
    }
}

Privacy & Terms