# check that users have entered a valid def int_check(question): while True: error = "Please enter and integer that is 1 or more." to_check = input(question) # check for infinite mode if to_check == "": return "infinite" try: response = int(to_check) # checks that the number is more than / equal to 13 if response < 1: print(error) else: return response except ValueError: print(error) # Main routine Stars here # Intialise game variables mode = "regular" round_played = 0 rps_list = ["rock", "paper", "scissors", "xxx"] print("πŸ’ŽπŸ“βœ‚οΈRock / Paper / Scissors Game βœ‚οΈπŸ“πŸ’Ž") print() # Instructions # Ask user for number of rounds / infinite mde num_rounds = int_check("How many rounds would you like? Push for infinite mode: ") if num_rounds == "infinite": mode = "infinite" num_rounds = 5 # Game loop starts here while round_played < num_rounds: # Rounds headings if mode == "infinite": rounds_heading = f"\n∞ ∞ ∞ Round {round_played + 1} (infinite Mode) ∞ ∞ ∞" else: rounds_heading =f"\nπŸ’ΏπŸ’ΏπŸ’Ώ Round {round_played + 1} of {num_rounds} πŸ’ΏπŸ’ΏπŸ’Ώ" print(rounds_heading) print() user_choice = input("Choose: ") if user_choice == "xxx": break round_played += 1 # if users are in infinite mode, increase number of rounds! if mode == "infinite": num_rounds += 1 # Game History / Statistics area