Question: app.background = gradient ( ' mediumSeaGreen ' , 'seaGreen' ) # variables representing the card's suit app.diamonds = 0 app.hearts = 1 app.clubs = 2
app.background gradientmediumSeaGreen 'seaGreen'
# variables representing the card's suit
app.diamonds
app.hearts
app.clubs
app.spades
# variables for the red suit color and black suit color
app.redColor 'tomato'
app.blackColor 'dimGrey'
def drawHeartsx y color:
# draws a heart
Polygonx y x y x y fillcolor
Polygonx y x y x y fillcolor
Polygonx y x y x y fillcolor
def drawDiamondsx y color:
# draws a diamond
Rectx y fillcolor, rotateAngle align'center'
def drawClubsx y color:
# draws a clover clubs
Rectx y fillcolor, rotateAngle align'center'
Rectx y fillcolor, rotateAngle align'center'
Rectx y fillcolor, rotateAngle align'center'
def drawSpadesx y color:
# draws a spade
Polygonx y x y x y fillcolor
Polygonx y x y x y fillcolor
def drawCardx y rank, suit:
# draws the base of the card and its shadow
Rectx y opacity
Rectx y fill'white', border'darkGrey'
# Depending on the card's suit, set the helper variable, suitColor, accordingly.
# Then draw the correct symbol for the suit at the middle of the card.
### HINT: Hearts and diamonds are red cards, clubs and spades are black cards.
### HINT: There are some helpful functions written for you above.
### Fix Your Code Here ###
suitColor 'black'
drawHeartsx y suitColor
# draws the card using the determined suit color
Rectx y fillNone, bordersuitColor, dashesTrue
Polygonx y x y x y fillsuitColor
Polygonx y x y x y fillsuitColor
Polygonx y x y x y fillsuitColor
Polygonx y x y x y fillsuitColor
Labelrank x y fillsuitColor
Labelrank x y fillsuitColor
##### Place your code above this line, code below is for testing purposes #####
# test case:
drawCardA app.diamonds
drawCardK app.diamonds
drawCardQ app.diamonds
drawCardJ app.diamonds
drawCard app.diamonds
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
