Good old Fashioned Franglais: Salut! Je vas Guesser ton number

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NumberWizard : MonoBehaviour
{

int Biggest = 1000;
int Smallest = 1;
int guess = 500;


// Start is called before the first frame update
void Start()
{
    Debug.Log("Salut! Je vas Guesser ton number");
    Debug.Log("Picker un number emtre: " + Smallest);
    Debug.Log("et: " + Biggest);
    Debug.Log("et je vas guesser ton number");
    Debug.Log("Is ton number" + guess + "? Presser Retour");
    Debug.Log("Ou is ton number plus higher? Presser en haut");
    Debug.Log("Or is ton number plus bas? Presser en bas");
    Biggest = Biggest + 1;
}

// Update is called once per frame
void Update()
{ 
    if (Input.GetKeyDown(KeyCode.UpArrow))
    {
        Debug.Log("Ton number c'est plus bigger than I penser");
        Smallest = guess;
        guess = (Smallest + Biggest) / 2;
        Debug.Log(guess);
    }

    else if (Input.GetKeyDown(KeyCode.DownArrow))
    {
        Debug.Log("Ton number c'est plus smaller than I penser");
        Biggest = guess;
        guess = (Smallest + Biggest) / 2;
        Debug.Log(guess);
    }

    else if (Input.GetKeyDown(KeyCode.Return))
    {
        Debug.Log("I savait it!");
    }
}

}

1 Like

Amazing code!