"""
CS 1109 2023SU
Lab 5: User vs. Machine Number Guessing
Authors: ENTER YOUR NAME HERE
         Zachary J. Susag
"""

# Import the randint function from the random module.
from random import randint

def user_guess():
    """
    Randomly selects a number between 1 and 100 inclusive and
    repeatedly prompts the user to enter a number to guess as input.

    For each guess made by the user, 
    - If the guess is too low, then prints a message saying so
    - If the guess is too high, then prints a message saying so
    - If the guess is correct, a victory message is displayed along with the
      number of guesses made and the function terminates.

    This function does not return anything.
    """

def machine_guess():
    """
    Prompts the user to enter a number between 1 and 100 to act
    as the number which the machine must guess.

    Until the "secret" number is guessed correctly, repeatedly do the following:
    - Generate a random number between the best lower bound guessed so far
      (initially 1) and the best upper bound so far (initially 100) and
      `print` it to the user. For example, if the "secret" number is 50, and
      the machine has already guessed 25 and 75, then a random number should
      be generated between 26 and 74 (both inclusive).
   - Prompt the user to enter 'H' if the guessed number is too high, 'L'
     if the guessed number is too low, or 'C' if the guessed number is correct.
   - If `'C'` is entered, a victory message and the total number of gusses made
     should be printed and then the function should terminate.

    This function does not return anything.
    """




# ----------------- DO NOT MODIFY CODE BELOW THIS LINE ------------------------ #    

print('Welcome to the Cornell Number Guessing Game!')
print('--------------------------------------------')
print('Please enter which game mode you\'d like to play:')
print('  - "U": If you would like to guess the number')
print('  - "M": If you want the machine to guess the number')

mode = input('Enter game mode (U/M): ')
while mode != 'M' and mode != 'U':
    print('Invalid game mode selected. Please enter either "U" or "M" (case-matters!).')
    mode = input('Enter game mode (U/M): ')

if mode == 'U':
    user_guess()
else:
    machine_guess()
      

