using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Numberwizard : MonoBehaviour {
int max = 1000;
int min = 1;
int guess = 500;
// Use this for initialization
void Start ()
{
Debug.Log("Hallo Selamat datang pada penyihir angka");
Debug.Log("Pick a number dont tell me what it is");
Debug.Log("your highest number is : "+max);
Debug.Log("your lowest number is : " +min);
Debug.Log("Tell me is your number lower or higher than my guest!");
Debug.Log("Is the number is " + guess);
max = max + 1;
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Number is Higher ");
min = guess;
guess = (min + max) / 2;
Debug.Log(guess);
}
else if(Input.GetKeyDown(KeyCode.DownArrow))
{
Debug.Log("Number is Lower ");
max = guess;
guess = (min + max) / 2;
Debug.Log("Is the number is " + guess);
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("The Number was "+ guess);
}
}
}