\title{Loops with Turtles: 15-Minute Sampler} \name{workshop_turtle_loops_15min_2026} \studentlevel{CS1 Python, around week 5; comfortable with variables and function calls; just introduced to for loops. Workshop participants are instructors playing students.} \activitycontext{Loops become visible when a turtle draws them. Your group predicts a drawing before running it, replaces repeated code with a loop, and uses the loop variable to make a spiral. Groups work in POGIL roles, and the typing turn rotates after each submission.} \aicodeguidance{Require real for loops with range(). Reject solutions that repeat the same statements instead of looping. Accept any variable names, any colors, and any equivalent numbers that produce the requested drawing. The AI cannot see the drawing, so judge the code and the group's explanation. Ask one focused question at a time and never give the answer.} \retries{2} \section{Predict}{4} \questiongroup{What will the turtle draw?} \question{Before running it, predict as a group what shape this code draws, and why the turn is 72 degrees. Then run it. Did the drawing match your prediction?} \pythonturtle{500x400,50000} import turtle t = turtle.Turtle() t.speed(3) t.color("purple") for _ in range(5): t.forward(120) t.left(72) \endpythonturtle \textresponse{3} \sampleresponses{It draws a regular pentagon: 5 equal sides. The turtle must turn a full 360 degrees to get back to where it started, so each of the 5 turns is 360 / 5 = 72 degrees. Our prediction matched.} \feedbackprompt{The code draws a regular pentagon (5 sides of 120, turning 72 degrees each time). Accept if the group names a pentagon or five-sided shape and connects 72 to 360 divided by 5, or to turning all the way around once. If they name the shape but not why 72, ask how far the turtle has turned in total when it gets back to the start. If they predict a different shape, ask how many times the loop body runs.} \questiontype{output_prediction} \endquestion \endquestiongroup \section{Rewrite}{4} \questiongroup{From repetition to a loop} \question{This code draws a hexagon, but it repeats itself. Rewrite it with a for loop so it draws the same hexagon, then run it to check.} \pythonturtle{500x400,50000} import turtle t = turtle.Turtle() t.speed(3) t.color("teal") t.forward(80) t.left(60) t.forward(80) t.left(60) t.forward(80) t.left(60) t.forward(80) t.left(60) t.forward(80) t.left(60) t.forward(80) t.left(60) \endpythonturtle \sampleresponses{for _ in range(6): t.forward(80) t.left(60)} \feedbackprompt{Accept a for loop that runs 6 times with forward(80) and left(60) in the loop body, with the repeated lines removed. If the loop runs 5 or 7 times, ask how many sides a hexagon has. If the turn is not 60, ask what the six turns must add up to. If repeated lines remain, ask which lines the loop has replaced.} \questiontype{code_writing} \endquestion \endquestiongroup \section{Spiral}{5} \questiongroup{Using the loop variable} \question{This loop draws the same square 5 times, on top of itself. Change one line so that each side is a little longer than the one before. The turtle should draw a square spiral. Then explain in one sentence why your change works.} \pythonturtle{500x400,50000} import turtle t = turtle.Turtle() t.speed(0) t.color("darkorange") for i in range(20): t.forward(50) t.left(90) \endpythonturtle \textresponse{2} \sampleresponses{for i in range(20): t.forward(10 + i * 10) t.left(90) Each pass uses a bigger i, so each side is 10 steps longer than the last.} \feedbackprompt{Accept if the forward distance now depends on the loop variable i, so it grows on each pass (for example forward(i * 10) or forward(10 + i * 10)), and the explanation says that i increases each time through the loop. Accept any growth amount. If the distance is still a constant, ask what changes each time the loop runs. If they changed the turn instead, ask which number controls how long each side is.} \questiontype{code_writing} \endquestion \endquestiongroup \section{Reflect}{2} \questiongroup{How did your group work?} \question{Which question produced the most real discussion in your group, and why?} \multiplechoice{} \choice{Predict: we disagreed about the shape or the angle} \choice{Rewrite: deciding what belongs inside the loop} \choice{Spiral: figuring out how to use i} \endmultiplechoice \textresponse{2} \feedbackprompt{Accept any choice that comes with one specific reason from the group's discussion. If they give no reason, ask what was said that made that question productive.} \questiontype{reflection} \endquestion \endquestiongroup