Apr-14-2019, 12:21 AM
i have to draw 6 groups of "card stacks" using turtle graphics only, position the stacks accordingly and then put a design on the cards - then will once the drawing is complete i need it to run certain functions required by the task
here is my start to my code ( i am a beginner just learning haha) - i am trying to draw the card stacks
#create card stack drawings, position them and draw
#stack 1
s1 = turtle.Turtle()
s1.hideturtle()
s1.penup()
s1.goto(-449,375)
s1.showturtle()
s1.pendown()
s1.forward(stack_width / 2)
s1.right(90)
s1.forward(stack_width)
s1.right(90)
s1.forward(stack_width)
s1.right(90)
s1.forward(stack_width)
s1.stack_gap = (table_width - num_stacks * stack_width) // (num_stacks + 1)
s1.card_stack = ('S1','S2','S3','S4','S5','S6')
s1.card_suits = ('A=Clubs', 'B=Diamonds', 'C=Hearts', 'D=Spades')
s1.card_values =('2','3','4','5','6','7','8','9','10','J','Q','K','A')
s1.max_cards = 10
here is my start to my code ( i am a beginner just learning haha) - i am trying to draw the card stacks
#create card stack drawings, position them and draw
#stack 1
s1 = turtle.Turtle()
s1.hideturtle()
s1.penup()
s1.goto(-449,375)
s1.showturtle()
s1.pendown()
s1.forward(stack_width / 2)
s1.right(90)
s1.forward(stack_width)
s1.right(90)
s1.forward(stack_width)
s1.right(90)
s1.forward(stack_width)
s1.stack_gap = (table_width - num_stacks * stack_width) // (num_stacks + 1)
s1.card_stack = ('S1','S2','S3','S4','S5','S6')
s1.card_suits = ('A=Clubs', 'B=Diamonds', 'C=Hearts', 'D=Spades')
s1.card_values =('2','3','4','5','6','7','8','9','10','J','Q','K','A')
s1.max_cards = 10