this is the code I have witch should be identical to the code in the video ( half way through), can someone please point out what I have missed or done wrong.
I am running unity 4.6.9.
this is my code
using UnityEngine;
using System.Collections;
public class NumberWizard : MonoBehaviour {
// Use this for initialization
int max = 1000;
int min = 1;
int guess = 500;
void Start () {
print ("Welcome to Nmber Wizard");
print ("Pick a number in your head, but dont tell me");
print ("The highest number you can pick is " + max);
print ("The lowest number you can pick is " + min);
print ("Is the number higher or lower than " + guess);
print ("up-arrow for higher, down arrow for lower, return for equal");
}
// Update is called once per frame
void Update () {
if (Input.GetKeyDown(KeyCode.UpArrow)) {
//print ("up-arrow key was pressed");
min = guess;
guess = (max + min) / 2;
print ("Is the number higher or lower than " + guess);
} else if (Input.GetKeyDown(KeyCode.DownArrow)) {
//print ("down-arrow key was pressed");
max = guess;
guess= (max + int) / 2;
print ("Is the number higher or lower than + guess");
} else if (Input.GetKeyDown(KeyCode.Return)) {
print ("i won");
}
}
}
thank you.
edit: I have now fixed the red error and only need to fix the <RI.Hif> error