import random

def start_game():
    # The computer picks a random number between 1 and 10
    secret_number = random.randint(1, 10)
    attempts = 0
    
    print("--- The Number Guessing Game ---")
    print("I'm thinking of a number between 1 and 10.")

    while True:
        try:
            guess = int(input("Enter your guess: "))
            attempts += 1

            if guess < 1 or guess > 10:
                print("Hey! Stay between 1 and 10.")
                continue

            if guess < secret_number:
                print("Too low! Try again.")
            elif guess > secret_number:
                print("Too high! Try again.")
            else:
                print(f"🎯 Correct! It took you {attempts} attempts.")
                break
        except ValueError:
            print("That's not a number! Please enter a digit.")

if __name__ == "__main__":
    start_game()