using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizard : MonoBehaviour
{
public int max = 1000;
public int min = 1;
public int guess = 500;
// Start is called before the first frame update
void Start()
{
Debug.Log("Bonjour et bienvenue dans Number Wizard");
Debug.Log("Choisissez un nombre sans me le dire...");
Debug.Log("Le nombre minimum possible est : " + min);
Debug.Log("Le nombre maximum possible est : " + max);
min--;
Debug.Log("Dites-moi si votre nombre est plus petit ou plus grand que : " + ((min + max) / 2) + " ?");
Debug.Log("Appuyez sur FlècheHaut si votre nombre plus grand, FlècheBas s'il est plus petit ou bien tapez Entrée si mon choix est correct.");
min++;
max++;
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
min = guess;
guess = ((min + max) / 2);
Debug.Log("Is it lower, higher or equal to: " + guess + "?");
}
else if (Input.GetKeyDown(KeyCode.DownArrow))
{
max = guess;
guess = ((min + max) / 2);
Debug.Log("Is it lower, higher or equal to: " + guess + "?");
}
else if (Input.GetKeyDown(KeyCode.Return))
{
Debug.Log("I found out, your number was: " + guess);
}
}
}