Question: CEN 4 8 8 - Homework 4 - Spring 2 0 2 4 This homework is the repetition of the second homework by using object
CEN Homework Spring This homework is the repetition of the second homework by using objectoriented programming, with the following requirements: Each player must be an instance of a class. The class should have appropriate attributes and methods. One of the private attributes should record the players' previous plays Number of players, the order and total the points of the player at the end of each game A getter method should return the past plays of the player. The Game is also an instance of the classes. The Game class must record the previous plays name of the payers and the winner as a private attribute. A class method should display or print to a file the data of the previous plays: If there is no argument, the data must be displayed on the screen; otherwise, if there is a proper file name, the file must be created with the data of the previous plays. If the argument does exist but it is not a proper file name, The file name should be Gameddmmyynntxt where the current day, month and year are represented by dd mm and yy respectively. The nn is a digit decimal number that represents the order of the play in the current day. The nd Homework : The objective of the game is to get rid of the cards in each players hand. When the cards in any players hand finish, the current round ends, and the total points of the rest of the players are added to their account. If the points of any player exceed that player leaves the game. The game continues till the last player remains. This one is the winner of the game. The game starts with determining the number and name of players. The number of players should be to Each player may prefer to use their name or a nickname, which is assigned to the player randomly from a list of nicknames you defined in your code. Each round starts with assigning cards randomly to each player from a set of decks. At each round, the first player position shifts towards the next one. At the beginning of each round, the first player puts any one of the cards in the hand onto the table. The next player must put an appropriate card onto the table. Any player, who does not have an appropriate card, must draw cards from the undealt part of the deck, till finding a card to put on the table. An "appropriate card" is any card, which has at least one common value with the card on the table. At the end of each round, the points of each player are calculated by summing up all card values remaining in the players hand: Each card value is determined by adding the card number to the suit value: Suits: Clubs points; Diamonds points; Hearts points; Spades points Numbers equal their values, and A: points, J: points, Q: points, K: points. Upload your code as a python file py RULE: The programmer manages the players and selects cards for the player, each player's right to turn continues in turn. round consists of games for each player. There should be a card selection menu with at least and a maximum of options in each game. Cards that may be suitable are randomly shown, the programmer selects that card, if there is no suitable card. Each player can draw cards until they reach a maximum of cards. After completing one round, each player returns to the beginning for the second round. When the player's right to play ends, the scores of that round are kept and added up with the score at the end of the next round. Whoever reaches is eliminated and the game continues until player remains. The last remaining player wins.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
