to cforward :distance while [:distance > 0] ; Go until it's time to stop. ~ [ if (xcor * xcor + ycor * ycor) > 10000 ; Check if inside circle. ~ [penup ; If not, "wrap". setx -1 * xcor sety -1 * ycor pendown] make "distance :distance-1 ; Decrease distance left to go. forward 1 ] end