There was an error while loading. Please reload this page.
turtle
1 parent 9622dec commit e987990Copy full SHA for e987990
1 file changed
Doc/library/turtle.rst
@@ -159,14 +159,16 @@ filling can be turned on and off::
159
160
Next we'll create a loop::
161
162
+ start = pos()
163
+
164
while True:
165
forward(200)
166
left(170)
- if abs(pos()) < 1:
167
+ if distance(start) < 1:
168
break
169
-``abs(pos()) < 1`` is a good way to know when the turtle is back at its
-home position.
170
+``distance(start) < 1`` is a good way to know when the turtle is back at its
171
+start position.
172
173
Finally, complete the filling::
174
0 commit comments