From be2d3fa882b823b68f6c135737f2f2c8b091e865 Mon Sep 17 00:00:00 2001 From: ZevilLacer <51844240+ZevilLacer@users.noreply.github.com> Date: Sat, 27 Jul 2019 17:27:29 +0530 Subject: [PATCH] script --- script | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 script diff --git a/script b/script new file mode 100644 index 0000000..52db42c --- /dev/null +++ b/script @@ -0,0 +1,109 @@ +using UnityEngine; + +using System.Collections; + + + +public class nowizz : MonoBehaviour { + + + + int max=1000,min=1,guess=500; + + + + void Start () + + + + { + + + + game(); + + max=max+1; + + } + + void game () + + { + + print("WELCOME TO THE NUMBER WIZARD CONSOLE GAME"); + + print("Pick a number in ur head,without telling me:"); + + print("The Highest Number you can pick is " +max); + + print("The lowest Number you can pick is " +min); + + + + print("Is the number you picked higher or lower than " +guess); + + print("Press UP Arrow key for higher ,DOWN Arrow key for lower ,RETURN for equal"); + + + + } + + void nextguess() + + { + + guess=(max+min)/2; + + print("Higher or lower than " +guess); + + print("Press UP Arrow key for higher,DOWN Arrow key for lower ,enter for equal"); + + + + } + + + + + + void Update () + + + + { + + if (Input.GetKeyDown(KeyCode.UpArrow)) + + { + + min = guess; + + nextguess(); + + } + + + + if (Input.GetKeyDown(KeyCode.DownArrow)) + + { + + max = guess; + + nextguess(); + + } + + + + if (Input.GetKeyDown(KeyCode.Return)) + + { + + print("The no. you guessed is"+guess); + + } + + } + +}