#------------------------------------------------------ # Project: 21 Number Game # Standard: 91883 (AS1.7) v.1 # School: Tauranga Boys' College # Author: Lincoln William Rolleston # Date: DATE COMPLETED # Python: 3.5 #------------------------------------------------------ #Imports import random import time #Variables max_chips = 21 min_chips = 0 player_one = " " player_two = " " chips_left = 0 chips_taken = " " #Introduction print ("\033c") print("In this game You and your friend will take turns taking either 1,2, or 3 chips out of 21 until you hit zero.") time.sleep(0.5) print("Whoever ends on zero/takes the final chips wins the game becasue it doesn't allow your oppenent to take anymore chips") print() time.sleep(0.5) player_one = input("Please enter player ones name: ") player_two = input("Please enter player two name: ") def main(): while True: chips_taken = int(input(f"{player_one}, Take some chips: ")) if 1 <= chips_taken <= 4 and chips_taken <= chips_taken: print(f"{player_one} took {chips_taken} chips") return else: print("Invalid input. Please enter a number between 1 to 3") while True: chips_taken = int(input(f"{player_two}, Take some chips: ")) if 1 <= chips_taken <= 3 and chips_taken <= chips_taken: return else: print("Invalid input. Please enter a number between 1 to 3") main()