Skip to content

Latest commit

 

History

History
159 lines (134 loc) · 5.23 KB

File metadata and controls

159 lines (134 loc) · 5.23 KB

Week 7 – Turtle Art Gallery (Turtle Basics)

Objectives

  • Understand the Turtle graphics coordinate system
  • Use basic Turtle commands: forward(), right(), left(), goto()
  • Create simple shapes using loops
  • Understand functions for reusable drawing patterns
  • Use penup/pendown to control drawing

Concept explanation (kid-friendly)

  • Turtle is like having a robot pen that draws on a canvas.
  • We tell the turtle where to move and when to draw.
  • It's similar to Scratch's "pen down" blocks, but we write code instead of drag-and-drop.
  • Functions help us reuse drawing patterns (like "My Blocks" in Scratch).

Connection to Scratch

  • Turtle forward(50) is like "move 50 steps" in Scratch
  • Turtle right(90) is like "turn right 90 degrees"
  • penup/pendown is exactly like Scratch's pen up/down
  • The coordinate system (0,0 is center) is the same as Scratch stage

Lesson flow (60–75 min)

1) Warm-up (5–10 min)

  • Review: "What is a function?" (from Week 6)
  • Quick demo: Open week07.py and run it
  • Observe: three squares appear in different places
  • Ask: "How did the turtle get to different positions?"

2) New concept (10–15 min)

Explain Turtle basics:

  • Turtle screen: The canvas where we draw (has coordinates like a graph)
  • Turtle object: The "robot pen" that moves and draws
  • Basic moves: forward, backward, right, left
  • Pen control: penup (stop drawing), pendown (start drawing)
  • Positioning: goto(x, y) moves to exact coordinates

Demo these commands live:

import turtle
t = turtle.Turtle()
t.forward(100)    # Move forward 100 pixels
t.right(90)       # Turn right 90 degrees
t.forward(100)    # Draw another line

Show coordinate system on board:

  • Center is (0, 0)
  • Right is positive X, left is negative X
  • Up is positive Y, down is negative Y

3) Guided build (20–25 min)

Walk through week07.py together:

Part A: Setup (5 min)

screen = turtle.Screen()     # Create the canvas
screen.title("Art Gallery")  # Set window title
t = turtle.Turtle()          # Create our drawing turtle
t.speed(6)                   # Set drawing speed (1-10)

Part B: Drawing function (10 min)

def draw_square(size):
    for _ in range(4):      # 4 sides for a square
        t.forward(size)     # Draw one side
        t.right(90)         # Turn 90 degrees
  • Explain: Why range(4)? (A square has 4 sides)
  • Explain: Why right(90)? (Square corners are 90 degrees)
  • Ask: "What would happen if we used 60 degrees?" (It wouldn't be a square)

Part C: Using goto (10 min)

draw_square(60)                        # First square at center
t.penup(); t.goto(120, 0); t.pendown() # Move right without drawing
draw_square(90)                        # Second square
  • Explain: penup/pendown controls whether the turtle draws while moving
  • Explain: goto(x, y) moves to exact position
  • Demo: What happens without penup? (Line drawn between squares)

4) Independent challenge (15–20 min)

Task A: Run and observe

  • Run the program
  • Count how many squares appear
  • Identify where each square is located

Task B: Modifications (student_tasks.md)

  • Change square sizes
  • Change goto positions to create new arrangements
  • Change turtle speed

Task C: Creative challenge

  • Add a 4th square in a new position
  • Try drawing a triangle (3 sides, 120-degree turns)
  • Experiment with different colors using t.color("blue")

5) Wrap-up (5 min)

Ask students to explain:

  • "What does goto() do?"
  • "Why do we use penup and pendown?"
  • "How is the draw_square function helpful?"
  • "How many degrees does the turtle turn for a square?"

Common errors to demo on purpose

  1. Forgetting penup before goto

    • Shows: Line drawn between shapes
    • Fix: Add t.penup() before goto, t.pendown() after
  2. Wrong turn angle

    def draw_square(size):
        for _ in range(4):
            t.forward(size)
            t.right(60)  # Wrong! Should be 90
    • Shows: Shape isn't a square
    • Fix: Use 90 degrees for square corners
  3. Forgetting screen.mainloop()

    • Shows: Window closes immediately
    • Fix: Add screen.mainloop() at the end
  4. Wrong coordinates

    • Using huge numbers: goto(10000, 5000)
    • Shows: Turtle goes off-screen
    • Fix: Keep coordinates reasonable (-300 to 300)

Success criteria

  • Student can run the program and see three squares
  • Student can explain what goto() does
  • Student can modify square sizes and positions
  • Student can add a new shape to the canvas
  • Student understands the difference between penup and pendown

Differentiation

For students who need support:

  • Provide a template with goto coordinates pre-filled
  • Start with just modifying sizes, not positions
  • Use visual coordinate grid handout

For advanced students:

  • Draw 5+ shapes in a pattern
  • Create a function for triangles or hexagons
  • Add colors to different shapes
  • Try using turtle.circle() to add circles

Materials needed

  • Thonny IDE installed
  • week07.py file
  • Optional: Printed coordinate grid for visualization
  • Optional: Scratch project showing pen up/down for comparison

Homework/practice

  • Draw your initials using turtle commands
  • Create a simple house (square for base, triangle for roof)
  • Experiment with different shapes (triangle, pentagon, hexagon)