From 08061230d8c6bcb1f5e0f74ef27dd8fffdb34cfc Mon Sep 17 00:00:00 2001 From: ZevilLacer <51844240+ZevilLacer@users.noreply.github.com> Date: Sat, 27 Jul 2019 17:32:53 +0530 Subject: [PATCH 1/3] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0bc48e..258ca16 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # UnityPublic -C#Scripts +C#Scripts for the game GuessBot(UI) +its a game where the bot will guess a number u choose in mind in between 1 to 1000. +Bot will have a certain number of tries. +If bot can't guess the Number You win, If it guesses the number You Lose. + From 345811d38c2dde24d3ffd88da3859bf277db9513 Mon Sep 17 00:00:00 2001 From: ZevilLacer <51844240+ZevilLacer@users.noreply.github.com> Date: Sat, 27 Jul 2019 17:41:00 +0530 Subject: [PATCH 2/3] Create GuessBot(UI)(main_script) --- GuessBot(UI)(main_script) | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 GuessBot(UI)(main_script) diff --git a/GuessBot(UI)(main_script) b/GuessBot(UI)(main_script) new file mode 100644 index 0000000..cb1c6f8 --- /dev/null +++ b/GuessBot(UI)(main_script) @@ -0,0 +1,71 @@ + +using UnityEngine; + +using System.Collections; +using UnityEngine.UI; + + + +public class GuessGame : MonoBehaviour { + + + + public int max=1000,min=1,guess; + + public int MaxGuesses=12; + + public Text text; + + + + void Start () + { + StartGame(); + + } + + void StartGame() + { + max=1000; + min=1; + nextguess(); + + } + + public void nextguess() + + { + + guess = Random.Range(min,max+1); + text.text=guess.ToString(); + MaxGuesses=MaxGuesses-1; + if(MaxGuesses<=0) + { + Application.LoadLevel("Win"); + } + + + + } + + + public void GuessHigh() + { + + min = guess; + + nextguess(); + + } + + public void GuessLow() + { + max = guess; + + nextguess(); + } + + + + +} From 42067c861344b60fb92068e94a8a0137592ae4bd Mon Sep 17 00:00:00 2001 From: ZevilLacer <51844240+ZevilLacer@users.noreply.github.com> Date: Sat, 27 Jul 2019 17:41:59 +0530 Subject: [PATCH 3/3] Create GuessBot(UI)(levelManager) --- GuessBot(UI)(levelManager) | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 GuessBot(UI)(levelManager) diff --git a/GuessBot(UI)(levelManager) b/GuessBot(UI)(levelManager) new file mode 100644 index 0000000..734718f --- /dev/null +++ b/GuessBot(UI)(levelManager) @@ -0,0 +1,19 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LevelManager : MonoBehaviour +{ + public void LoadLevel(string name) + { + Debug.Log("Level load requested for"+name); + Application.LoadLevel(name); + } + + + public void QuitRequest() + { + Debug.Log("I wanna quit!"); + Application.Quit(); + } +}