# checks for an integer more than 0 (allows ) def int_checker(question): while True: error = "Please enter an 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 1 if response < 1: print(error) else: return response except ValueError: print(error) # Main Routine Starts here # Intialise game variables mode = "regular" rounds_played = 0 print("šŸ’ŽšŸ“„āœ‚ Rock / Paper / Scissors Game āœ‚šŸ“„šŸ’Ž") print() # Instructions # Ask user for a number of rounds / infinite mode num_rounds = int_checker("How many rounds would you like? Push for infinite mode: ") if num_rounds == "infinite": mode = "infinite" num_rounds = 5 # Game loop starts here while rounds_played < num_rounds: # Rounds headings if mode == "infinite": rounds_heading = f"\n ā™¾ļøā™¾ļøā™¾ļø Round {rounds_played + 1} (Infinite Mode) ā™¾ļøā™¾ļøā™¾ļø" else: rounds_heading = f"\nšŸ’æšŸ’æšŸ’æ Round {rounds_played + 1} of {num_rounds} šŸ’æšŸ’æšŸ’æ" print(rounds_heading) print() user_choice = input("choose: ") if user_choice == "xxx": break rounds_played += 1 # if users are in infinite mode, increase number of rounds! if mode == "infinite": num_rounds += 1 # Game loop ends here # Game History / Statistics area