Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class NumberWizrd : MonoBehaviour {
  5.  
  6. // Use this for initialization
  7. int max = 1001;
  8. int min = 1;
  9. int guess = 500;
  10.  
  11. void Start(){
  12. StartGame ();
  13. }
  14.  
  15. void StartGame () {
  16. Debug.Log("Welcome to The Great GNU-dini!!!");
  17. print ("Pick a number, in you head but don't tell me");
  18. print ("...actually...You probably could tell me");
  19. print ("since I am machine and don't have ears...");
  20. print ("...or do I?");
  21. print ("*snicker");
  22. print ("Anyway, let's get started. Shall, we?");
  23. print ("The lowest number you can pick is " + min);
  24. print ("Don't go over </size>" + max);
  25. print ("Is the number higher or lower than" + guess );
  26. print ("'Up arrow' = higher, 'Down arrow' = lower, 'Return' = equal");
  27. }
  28.  
  29. // Update is called once per frame
  30. void Update () {
  31. if (Input.GetKeyDown (KeyCode.UpArrow)) {
  32. min = guess;
  33. NextGuess ();
  34. } else if (Input.GetKeyDown (KeyCode.DownArrow)) {
  35. max = guess;
  36. NextGuess ();
  37. } else if (Input.GetKeyDown (KeyCode.LeftArrow)) {
  38. 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.");
  39. } else if (Input.GetKeyDown (KeyCode.RightArrow)) {
  40. print ("(Right) Seriously?!...What about Up or Down do you NOT understand?!");
  41. } else if (Input.GetKeyDown (KeyCode.Return)) {
  42. print ("Ha Ha!!! I knew it!");
  43. print ("Isn't it kray-zee how smart I am?");
  44. }
  45. }
  46.  
  47. void NextGuess () {
  48. guess = (max + min) / 2;
  49. print ("Okay...Is it higher or lower than " + guess);
  50. print ("'Up arrow' = higher, 'Down arrow' = lower, 'Return' = equal");
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement