""" ------------------------------------------------- Project: 2 Player Chip Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Rome Mackay Date: Start = 10/03/25 End = Python: 3.5 ------------------------------------------------- """ # Hey Sir. This is for my game to run smoove, and for the computer to understand what i needs to do to start the code import random import time max_chips = 21 playeronescore = 0 playertwoscore = 0 chipsleft = 21 chipstaken = 0 round = 1 # Starting rules, and game run through so player has an understanding of how to play. print("Welcome to my game, the rules are simple so stay ready and make sure you pay attention") time.sleep(2) print("You will be facing off against your opponent - together you two will say a number between 1 and 3, and the game goes to 21.") print("Whoever gets the last number closest to 21 wins. You can pick how many rounds you would like to play (MAX ROUNDS 5), and whoever comes out at the end with most ROUND wins takes the game.") time.sleep(2) print("Let's start with rounds, how many would you like to play? Take your time.") time.sleep(5) # This is so if they want to play one round or five they can. If they dont do any of the right inputs it will stop the game by a break while True: rounds = input("When you're ready, type '1' for one round, or '5' for five rounds: ") if rounds == '1': print("One round, quick and easy. Let's go!") break if rounds == '5': print("Five rounds, let's see who wins the most. Let's go!") break else: print("Huh? Please choose either '1' or '5'.") name = input("What is your name PLAYER ONE? ") print(f"Welcome, and always best of luck, {name}!") name = input("What is your name PLAYER 2? ") print(f"Welcome, and best of luck also {name}!") import time # Get user input to start game or to share the rules again. user_input = input("Enter 'a' for rules recap or 'b' to start the game: ") # Check if the input is "a" or "b" if user_input == "a": print("Starting final rules recap") time.sleep(2) print("You will be facing off against your opponent - together you two will say a number between 1 and 3, and the game goes to 21.") print("Whoever gets the last number closest to 21 wins. You can pick how many rounds you would like to play (MAX ROUNDS 5), and whoever comes out at the end with most ROUND wins takes the game.") if user_input == "b": print("Starting game") # Initialize variables chipsLeft = 20 # Starting number of chips playerOneScore = 0 playerTwoScore = 0 # Main game loop while chipsLeft > 0: # Player 1's turn player1_choice = int(input("Player 1, how many chips do you want to take? ")) chipsLeft -= player1_choice if chipsLeft <= 0: playerOneScore += 1 print("Player 1 wins the round!") break # Player 2's turn player2_choice = int(input("Player 2, how many chips do you want to take? ")) chipsLeft -= player2_choice if chipsLeft <= 0: playerTwoScore += 1 print("Player 2 wins the round!") break # Display the winner if playerOneScore > playerTwoScore: print("Player 1 is the overall winner!") if playerTwoScore > playerOneScore: print("Player 2 is the overall winner!") else: print("It's a tie!") 12