using System.Collections;
using System.Collections.Generic;
using UnityEngine;public class NumberWizard : MonoBehaviour
{
int maximum = 1000;
int minimum = 1;
int guess = 500;// Start is called before the first frame update void Start() { Debug.Log("Why hello there: welcome to number wizard!"); Debug.Log("Pick a number, but don't tell me what it is."); Debug.Log("Highest number you can pick is " + maximum); Debug.Log("Lowest number you can pick is " + minimum); Debug.Log("Tell me if your number is higher or lower than " + guess); Debug.Log("Push up if higher, push down if lower, push enter if it's your number"); maximum = maximum + 1; } // Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.UpArrow)) { minimum = guess; guess = (maximum + minimum) / 2; Debug.Log("Is your number " + guess); } else if (Input.GetKeyDown(KeyCode.DownArrow)) { maximum = guess; guess = (maximum + minimum) / 2; Debug.Log("Is your number " + guess); } else if (Input.GetKeyDown(KeyCode.Return)) { Debug.Log("Yay, I found your number!"); } }}
Probably not quoting this correctly, but wanted to post something!
and keep posting 