Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- This code will fill the canvas with light blue circles with a highlight on each.
- """
- speed(0)
- # This function will draw one row of 10 circles
- def draw_circle_row():
- for i in range(10):
- pendown()
- begin_fill()
- color("lightblue")
- circle(20)
- end_fill()
- penup()
- forward(40)
- # This function will draw a highlight on each bubble
- def make_highlight():
- for i in range(10):
- forward(10)
- left(90)
- forward(20)
- pendown()
- circle(10,90)
- penup()
- left(90)
- forward(30)
- left(90)
- forward(40)
- # This function will move Tracy from end of row up to the beginning of the row on top
- def move_up_a_row():
- left(90)
- forward(40)
- right(90)
- backward(400)
- # Send Tracy to starting position in bottom left corner
- penup()
- setposition(-180,-200)
- # Call circle drawing function 10 times to fill ten rows
- for i in range(10):
- draw_circle_row()
- move_up_a_row()
- # Move back to beginning
- right(90)
- forward(400)
- left(90)
- color("white")
- # Draw the highlight on each bubble row by calling highlight function and moving up a row
- for i in range(10):
- make_highlight()
- move_up_a_row()
Add Comment
Please, Sign In to add comment