Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class NumberWizrd : MonoBehaviour {
- // Use this for initialization
- int max = 1001;
- int min = 1;
- int guess = 500;
- void Start(){
- StartGame ();
- }
- void StartGame () {
- Debug.Log("Welcome to The Great GNU-dini!!!");
- print ("Pick a number, in you head but don't tell me");
- print ("...actually...You probably could tell me");
- print ("since I am machine and don't have ears...");
- print ("...or do I?");
- print ("*snicker");
- print ("Anyway, let's get started. Shall, we?");
- print ("The lowest number you can pick is " + min);
- print ("Don't go over </size>" + max);
- print ("Is the number higher or lower than" + guess );
- print ("'Up arrow' = higher, 'Down arrow' = lower, 'Return' = equal");
- }
- // Update is called once per frame
- void Update () {
- if (Input.GetKeyDown (KeyCode.UpArrow)) {
- min = guess;
- NextGuess ();
- } else if (Input.GetKeyDown (KeyCode.DownArrow)) {
- max = guess;
- NextGuess ();
- } else if (Input.GetKeyDown (KeyCode.LeftArrow)) {
- print ("(Left) Apparently, you do not understand basic instructions. Maybe you should have a nice long think about what it is you are actually doing in life.");
- } else if (Input.GetKeyDown (KeyCode.RightArrow)) {
- print ("(Right) Seriously?!...What about Up or Down do you NOT understand?!");
- } else if (Input.GetKeyDown (KeyCode.Return)) {
- print ("Ha Ha!!! I knew it!");
- print ("Isn't it kray-zee how smart I am?");
- }
- }
- void NextGuess () {
- guess = (max + min) / 2;
- print ("Okay...Is it higher or lower than " + guess);
- print ("'Up arrow' = higher, 'Down arrow' = lower, 'Return' = equal");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement