Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Game Overview The game starts off with 52 cards distributed among 4 players. Each player is given 13 cards. When the game begins, the first
Game Overview The game starts off with 52 cards distributed among 4 players. Each player is given 13 cards. When the game begins, the first player plays any card he/she wants. Typically this is the card with the highest rank of any suit. All other players have to follow the suit. If one of the other players doesn't have a card in that suit, he/she can play a card of any other suit. Typically, this is the lowest rank card the player chooses the play. The winner of a round is determined by the player who placed the highest ranked card of the suit on which the round began. (2 is the lowest rank and Ace is the highest.) The winner of the round scores a point and gets to place his/her card first at the beginning of the next round. This continues until there are no more cards left to play. Te winner is determined by the player who has won most number of rounds Getting Started Visit Blackboard and download the "bare bones" file homework5.py. Open the file in PyCharm and fill in the following information at the top 1. your first and last name as they appear in Blackboard 2. your Net ID (e.g. jsmith) 3. your Stony Brook ID # (eg.. 1 1 1 999999) 4. the coursc number (CSE 101) 5, the assignment name and number (Homework #5) Do not, under any circumstanccs, change the names of the functions or thcir argument lists. The automated CodeLoad testing system will be looking for exactly those functions provided in homework5.py. You will boe able to test your work by uploading your file to CodeLoad. Upload your final py file to Blackboard by the due date and time. Late work will not be graded. CSE 101- Fall 2017 Homework #5 Page 1 Code that crashes and cannot be graded will earn no credit. It is your responsibility to test your code by running it through CodeLoad and by creating your own test cases. Preliminaries For this homework assignment you will be working with the following classes that represent a playing card and a player: class Card: suit_sym-10: u2663',1: 'u2666', 2: '\u2665',3: u2660' rank_sym-0:'2', 1: 3', 2: '4', 3: 5',4: '6', 5: '7', 6: 8' def init (self, rank, suit): self.rankrank self.suit- guit def -repr(self) : return self.rank_sym[self.rank] self.suit_sym[self.suit] def eg (self, other): return self.suit == other.suit and self.ra nk == other.rank class Player def -init-self, self.card_list self "score = ca rd-list): -card_list def repr_(self) return ,cards: ' strself.card-list) + ', score : ' + str (self.score) Data Encoding for the suit Field in the Card Class
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started