""" ------------------------------------------------- Project: Take-Away Game Standard: 91883 (AS1.7) v.1 School: Tauranga Boys' College Author: Raymond Wilson Date: THE DATE YOU COMPLETED THE CODE Python: 3.5 ------------------------------------------------- """ import time #Play Variables CHIPS_RESET = 21 play_chips = 0 player1_wins = 0 player2_wins = 0 Chips_left = 0 Chips_take = 0 play_round = 0 rounds_played = 0.5 rematch = "n" Round_Display = 1 P2_Playcheck = 0 #Player1 name code input while True: player1_name = input("Welcome, What would you like us to call you player 1? ") if player1_name.isalpha() == True: time.sleep(1) print("Intresting... Welcome") break else: print("Letters only please") #Player 2 name while True: player2_name = input("Welcome, What would you like us to call you player 2? ") if player2_name.isalpha() == True: time.sleep(1) print("Less intresting.") break else: print("Letters only please") #Greeting the player print("Hello there Mr {}".format(player1_name)) print("oh and hi {}".format(player2_name)) #Round amount Check while True: play_round = int(input("How many rounds would we like to play today from 1-5" )) if play_round < 6: break else: print("Do we need to go back to school? becuase apparently WE DONT KNOW A NUMBER YET") #game--------------------------------------------------------------------------------------------------- Chips_left = CHIPS_RESET while rounds_played < play_round: #P1 amount gona take while True: Chips_take = int(input("Round {}, {}. {} Chips left. Pick 1,2 or 3 up".format(Round_Display, player1_name, Chips_left))) if 1 <= Chips_take <= 3: Chips_left = Chips_left - Chips_take print("There are {} left".format(Chips_left)) break else: print("Hey man between 1-3. Its ok you will get it.") #Win check while Chips_left < 1: player2_wins += 1 rounds_played += 1 Round_Display += 1 print("{} won the the round this round and is on {}".format(player2_name,player2_wins)) print("Overall score = {} Having {} and {} having {} wins".format(player1_name,player1_wins,player2_name,player2_wins)) #RESET CHIPS Chips_left = CHIPS_RESET P2_Playcheck = 1 break #P2 amount gona take while True: if P2_Playcheck == 0: Chips_take = int(input("Round {}, {}. {} Chips left. Pick 1,2 and 3 up".format(Round_Display,player2_name, Chips_left))) if 1 <= Chips_take <= 3: Chips_left = Chips_left - Chips_take print("There are {} left".format(Chips_left)) break else: print("Oi Stupid. 1,3 only. Like you know 1,2 and 3?") #Win check----------------------------------------------------- if Chips_left < 1: player1_wins += 1 rounds_played += 1 Round_Display += 1 print("{} won the the round this round and is on {}.".format(player1_name,player1_wins)) print("Overall score = ",player1_name,"Having ",player1_wins,"and",player2_name, "having {} wins".format(player2_wins)) #RESET CHIPS Chips_left = CHIPS_RESET #Win end if player2_wins > player1_wins: print("So uhhhhh congrats {}. we are gonna need to have a chat after this {}".format(player2_name, player1_name)) if player1_wins > player2_wins: print("OH YEAAAAAAAAAAAA PLAYER 1 WITH THE DUBBBBBBBBBBBBBB {} TO {} IN THE WAY OF THAT GUY {} GGEZ".format(player1_wins, player2_wins, player1_name)) if player1_wins == player2_wins: print("soooo..... it was a tie.")