# L-16 MCS 507 Wed 27 Sep 2023 : game_oracle_number.py

"""
This python script generates a random secret natural in [0,9] and
enters a dialogue with the user playing the game of guessing the secret.

This script is launched as a child process in pexpect_guessing_game.py
where the script that launches the child process guesses the number.
"""

from random import randint
SECRET = randint(0, 9)
print('Welcome to our number guessing game!')
while True:
    GUESS = int(input('give a natural number in [0, 9] : '))
    if GUESS == SECRET:
        break
    if GUESS < SECRET:
        print('-> your guess is too low')
    else:
        print('-> your guess is too high')
print('Congratulations!  You found the secret.')
