#------------------------------------------------- # Project: Pickup Game # Standard: 91883 (AS1.7) v.1 # School: Tauranga Boys' College # Author: Stefan Pendergrast # Date: # Python: 3.5 #------------------------------------------------- import time player1_score = 0 player2_score = 0 turn = "" MAX_CHIPS = 21 rounds_played = 0 chips_remaining = MAX_CHIPS while True : print("Welcome To Pickup Game!") print("") player_1name = input("Player 1 Name: ") print("") player_2name = input("Player 2 Name: ") print("") while True: try: rounds = int(input("How many rounds would you like to play? (1-5): ")) if rounds < 1 or rounds > 5 : print("Please choose a number between 1 and 5") else: break except: print("") print("Please enter a valid number") while rounds_played < rounds : print("") print("The Round Is Starting") time.sleep(1) while chips_remaining > 0 : turn = player_1name print("") print(player_1name +"'s", "Turn") print("") chips_taken = int(input("How Many Chips Would You Like To Take? (1-3) ")) chips_remaining = chips_remaining - chips_taken print("") print("There Are", chips_remaining, "Chips Remaining!") turn = player_2name print("") print(player_2name +"'s", "Turn") print("") chips_taken = int(input("How Many Chips Would You Like To Take? (1-3) "))\ chips_remaining = chips_remaining - chips_taken print("") print("There Are", chips_remaining, "Chips Remaining!") if chips_remaining < 1 : break if turn == player_1name : player1_score += 1 else : player2_score += 1 rounds_played += 1 print("") print("The Round Has Completed") print("") print(turn, "Wins The Round!") print("") print(player_1name + "'s", "Score Is:", player1_score ) print("") print(player_2name + "'s", "Score Is:", player2_score ) chips_remaining = MAX_CHIPS print("") print("GAME OVER!") print("") if player1_score > player2_score : print(player_1name, "Wins!") else : print(player_2name, "Wins!")