""" ------------------------------------------------- Project: Pick-Up Game Standard: TE PUNGA - Programming Assessment School: Tauranga Boys' College Author: Kye Libeccio Date: March 2024 Python: 3.11.9 ------------------------------------------------- """ #Max chips MAX_CHIPS = 21 #scores p1 = 0 p2 = 0 #chips remaning chipsleft = 0 #chips taken chipstaken1 = 0 chipstaken2 = 0 # asking for Players names while True: player1 = str(input("What is your name player one? ")) if player1.isalpha() == True: break else: print("Unless your Elon Musks' child tht aint yo name...") while True: player2 = str(input("What is your name player two? ")) if player2.isalpha() == True: break else: print("Unless your Elon Musks' child tht aint yo name...") #how many rounds while True: try: rounds = int(input("How many rounds would you like to play? (1-5): ")) if rounds < 1 or rounds > 5 : print("I said 1-5 where are your listening skills") else: break except: print("That aint even a number bro what am I supposed to do with that... ") #saying welcome and the rules rules = input("Welcome the both of you, Would you like to hear the rules? (yes/no): ") if rules == "yes": print("Okay so, player one will go first taking a chip then player two, whoever pick up the last chip wins") else: print("Ight your loss mate") while rounds > 0: chipsleft = MAX_CHIPS while chipsleft > 0 : print("chips left: ",chipsleft) chipstaken1 = int(input("{} pick how many you want to pick up (1-3): ".format(player1))) chipsleft = chipsleft-chipstaken1 if chipsleft < 1: p1 = p1 + 1 rounds = rounds - 1 print("{} has won the score is now: " .format(p1)) print("Player 1 score: {} \nPlayer 2 score: {}".format(p1,p2)) break print("chips left: ",chipsleft) chipstaken2 = int(input("{} pick how many you want to pick up (1-3): ".format(player2))) chipsleft = chipsleft-chipstaken2 if chipsleft < 1: p2 = p2+1 rounds = rounds - 1 print("{} has won the score is now: " .format(p2)) print("Player 1 score: {} \nPlayer 2 score: {}".format(p1,p2)) break if p1 > p2: print("{} has won the game".format(player1)) elif p2 > p1: print("{} has won the game".format(player2))