''' DS2000 Spring 2023 Sample code from class - making objects in the driver DS2000-War * two players * each player draws one card * whoever has the higher card gets two points * in case of a tie, flip another card * play 2-3 rounds, see who has the most points ''' # from [filename] import [classname] from card import Card from deck import Deck def main(): # create points and players p1_name = "Laney" p2_name = "Kayla" p1_points = 0 p2_points = 0 # Set up the deck d = Deck() d.shuffle() # initialize the number of points on the table points = 2 in_play = True rounds = 0 # Play two rounds: while in_play: # Play one round p1_card = d.draw() p2_card = d.draw() rounds += 1 # sanity check print print(p1_name, "got", p1_card) print(p2_name, "got", p2_card) # see who won the round if p1_card.number > p2_card.number: print(p1_name, "wins this round!\n") p1_points += points points = 2 if rounds > 2: in_play = False elif p2_card.number > p1_card.number: print(p2_name, "wins this round!\n") p2_points += points points = 2 if rounds > 2: in_play = False else: print("Tie on this round...\n\n") points += 2 input("Enter to continue...\n") # after the rounds over, print the points print(p1_name, "has", p1_points, "points") print(p2_name, "has", p2_points, "points") main()