Question: Please write some codes for blanks where Your code here is written. iPad 11:07 AM @ 80%- cs61aorg CS 61A Weekly Schedule Office Hours Staff

Please write some codes for blanks where "Your code here" is written.
 Please write some codes for blanks where "Your code here" is
written. iPad 11:07 AM @ 80%- cs61aorg CS 61A Weekly Schedule Office
Hours Staff Resources Policies TutorPiazza Magic: The Lambda-ing In the next part
of this lab, we will be implementing a card game! You can
start the game by typing: python3 cardgame.py This game doesn't work yet.
If we run this right now, the code will error, since we
haven't implemented anything yet. When it's working, you can exit the game
and return to the command line with Ctrl-C or Ctrl-D This game
uses several different files. Code for all the questions in this lab
can be found in classes. py . Some utility for the game
can be found in cardgame.py, but you won't need to open or

iPad 11:07 AM @ 80%- cs61aorg CS 61A Weekly Schedule Office Hours Staff Resources Policies TutorPiazza Magic: The Lambda-ing In the next part of this lab, we will be implementing a card game! You can start the game by typing: python3 cardgame.py This game doesn't work yet. If we run this right now, the code will error, since we haven't implemented anything yet. When it's working, you can exit the game and return to the command line with Ctrl-C or Ctrl-D This game uses several different files. Code for all the questions in this lab can be found in classes. py . Some utility for the game can be found in cardgame.py, but you won't need to open or read this file. This file doesn't actually mutate any instances directly - instead, it calls methods of the different classes, maintaining a strict abstraction barrier . If you want to modify your game later to add your own custom cards and decks, you can look in cards.py to see all the standard cards and the default deck; here, you can add more cards and change what decks you and your opponent use. Play online! If you want to try out the game before implementing it, check out this online version! To play with a friend, enter your name and the same Secret Word, and then press the Enter button. Rules of the Game This game is a little involved, though not nearly as much as its namesake. Here's how it goes: There are two players. Each player has a hand of cards and a deck, and at the start of each round, each player draws a card from their deck. If a player's deck is empty when they try to draw, they will automatically lose the game. Cards have a name, an attack stat, and a defense stat. Each round, each player chooses one card to play from their own hands. The card with the higher power wins the round. Each played card's power value is calculated as follows: (player card's attack) (opponent card's defense)2 For example, let's say Player 1 plays a card with 2000 ATK/1000 DEF and Player 2 plays a card with 1500 ATK/3000 DEF. Their cards' powers are calculated as: P1: 2000 3000/2 2080 1508 508 P2: 1500 1000/2 1500 500 1000 so Player 2 would win this round. The first player to win 8 rounds wins the match! iPad 11:07 AM @ 80%- cs61aorg CS 61A Weekly Schedule Office Hours Staff Resources Policies TutorPiazza Magic: The Lambda-ing In the next part of this lab, we will be implementing a card game! You can start the game by typing: python3 cardgame.py This game doesn't work yet. If we run this right now, the code will error, since we haven't implemented anything yet. When it's working, you can exit the game and return to the command line with Ctrl-C or Ctrl-D This game uses several different files. Code for all the questions in this lab can be found in classes. py . Some utility for the game can be found in cardgame.py, but you won't need to open or read this file. This file doesn't actually mutate any instances directly - instead, it calls methods of the different classes, maintaining a strict abstraction barrier . If you want to modify your game later to add your own custom cards and decks, you can look in cards.py to see all the standard cards and the default deck; here, you can add more cards and change what decks you and your opponent use. Play online! If you want to try out the game before implementing it, check out this online version! To play with a friend, enter your name and the same Secret Word, and then press the Enter button. Rules of the Game This game is a little involved, though not nearly as much as its namesake. Here's how it goes: There are two players. Each player has a hand of cards and a deck, and at the start of each round, each player draws a card from their deck. If a player's deck is empty when they try to draw, they will automatically lose the game. Cards have a name, an attack stat, and a defense stat. Each round, each player chooses one card to play from their own hands. The card with the higher power wins the round. Each played card's power value is calculated as follows: (player card's attack) (opponent card's defense)2 For example, let's say Player 1 plays a card with 2000 ATK/1000 DEF and Player 2 plays a card with 1500 ATK/3000 DEF. Their cards' powers are calculated as: P1: 2000 3000/2 2080 1508 508 P2: 1500 1000/2 1500 500 1000 so Player 2 would win this round. The first player to win 8 rounds wins the match

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!