Number Wizard from Baltimore

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("You dare challenge the Number Wizard?!");
    Debug.Log("Choose a coded number, and I will prove to you how easily your mind can be unlocked!");
    Debug.Log("Select any number code up too " + max);
    Debug.Log("No negativity here ! Your lowest code must be no lower than " + min);
    Debug.Log("Is your code greater or weaker than: " + guess);
    Debug.Log("Press Up = Higher, Press Down = Lower, Press Enter = Correct Code");
    max = max + 1;
}


void StartGame()
{





}


// Update is called once per frame
void Update()
{
    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
     
        min = guess;
        guess = (max + min) / 2;
        Debug.Log(" Is your code greater or weaker than " + guess);
       
    }
    else if (Input.GetKeyDown(KeyCode.DownArrow))
    { 
      
        max = guess;
        guess = (max + min) / 2;
        Debug.Log(" Is your code greater or weaker than " + guess);



    }
    else if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("I've achieved your coded number and unlocked your mind! There's alot of cat videos in there.");
    }
}

}

2 Likes

Very good job!

Very nice! I like the moment with cat videos, it’s very funny! :smiley:
By the way, I wonder what is that StartGame method you use it and why?
Everything else looks amazing! Keep going! :slight_smile:

1 Like

The StartGame method is what recalls the game to replay it / put it on a loop so it can be played again. :slight_smile:

Privacy & Terms