Number Wizard Wordsmithing

int max = 1000;
int min = 1;
int guess = 500;

// Start is called before the first frame update
void Start()
{
   
    Debug.Log("Well, hey there! You've arrived! Ready to have your number guessed?!");
    Debug.Log("Now, secretly pick any number. Remember IN SECRET, TELL NO ONE!!!");
    Debug.Log("We're working with the highest number of " + max);
    Debug.Log("And you can go no lower than " + min);
    Debug.Log("Tell me if your number is higher or lower than " + guess);
    Debug.Log("You can do this with the up and down arrow keys. Don't lie!!!");
    Debug.Log("AND ... when your number is correctly guessed ... hit ENTER!");
    max = max + 1;

}

// Update is called once per frame
void Update()
{
    //Detect Up arrow key pressed
    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("More?!! Really?? How about ... ");
        min = guess;
        guess = (max + min) / 2;
        Debug.Log(guess);
    }

    //Detect Down arrow key pressed
    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("Less, fine okay, what about ... ");
        max = guess;
        guess = (max + min) / 2;
        Debug.Log(guess);
    }

    //Detect Return/Enter key pressed
    else if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("Woohoo! Got it! Yay! Cool number btw");
    }

great text marlene very lively better then mine :wink:

void Start()
{

  Debug.Log("Welcome player one") ; 
  Debug.Log("Pick a number");
  Debug.Log("The Highest number you can choose is :" + max);
  Debug.Log("And the Lowest number :" + min);
  Debug.Log("Tell me if your number is higer or lower then: " + guess);
  Debug.Log("Push up for higer and down for lower and push enter if correct.");
  max = max + 1;
}

// Update is called once per frame
void Update()
{

    if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("Who's a genius? :P.");
    } 
  else if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        min = guess;
        guess = (max + min) / 2;
        Debug.Log("Is it higer or lower tan... " + guess);
    } 
    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        max = guess;
        guess = (max + min) / 2;
        Debug.Log("Is it higer or lower tan... " + guess);
    } 
       
  ; 
          
}

}

Thanks! Just having fun!

Privacy & Terms