Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions script
Original file line number Diff line number Diff line change
@@ -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);

}

}

}