""" --------------------------------------------------- Project: Pick Up Game Standard: TE PUNGA - Programming Assessment School: Tauranga Boys College Auther: Jack W Davie Python: 3.11.9 --------------------------------------------------- """ MAX_CHIPS = 21 player1score = 0 player2score = 0 chipsleft = 0 chipstaken = 0 playersturn = 0 currentplayersname = "billy maze" player1name = input("player one, please enter your name: ") player2name = input("player two, please enter your name: ") while True : try : rounds = int(input("how many rounds would you like to play (1-5)")) if rounds < 1 or rounds > 5 : print("too many or too few rounds") else: break except : print("not a valid number") while rounds > 1 : chipsleft = MAX_CHIPS playersturn = 1 currentplayersname = player1name while chipsleft > 0 : print("there're {} chips left...".format(chipsleft)) print("{}'s turn: how many chips do you want to take?".format(currentplayersname)) print() print(""" [1] [2] [3] """) while True : try : chipstaken = int(input("how many chips would you like to take (1-3)")) if chipstaken < 1 or chipstaken > 3 : print("too many or too few chips") else: chipsleft = chipsleft - chipstaken if chipsleft < 1 : if currentplayer == 1 : player1score = player1score + 1 else : print("{} wins! the scores are as follows...".format(currentplayersname)) else : if playersturn == 1 : print("{} has taken {} chips,".format(player1name, chipstaken)) else : print("{} has taken {} chips,".format(player2name, chipstaken)) print("now there are {} chips left in the game".format(chipsleft)) except : print("not a valid number")