We can make all motions of a turtle slower by using a form of forward that includes sleep

What will be an ideal response?

```
def pausedForward(turtle ,amount):
sleep (0.2)
turtle.forward(amount)
```

Rewrite the chase and dance functions to use pausedForward.
from time import sleep

```
def chaseSlow ():
# Set up the four turtles
earth = World ()
al = Turtle(earth)
bo = Turtle(earth)
cy = Turtle(earth)
di = Turtle(earth)
al.penUp()
al.moveTo(10,10)
al.penDown()
bo.penUp()
bo.moveTo(10,400)
bo.penDown()
cy.penUp()
cy.moveTo(400,10)
cy.penDown()
di.penUp()
di.moveTo(400,400)
di.penDown()
# Now , chase for 300 steps
for i in range (0 ,300):
chaseTurtle(al,cy)
chaseTurtle(cy,di)
chaseTurtle(di,bo)
chaseTurtle(bo,al)

def chaseTurtle(t1,t2):
t1.turnToFace(t2)
pausedForward(t1, 4)

def danceSlow ():
makesquare()

def makesquare ():
w = makeWorld()
evenlist = []
oddlist = []
for turtles in range (10):
t = makeTurtle(w)
t.turn(turtles*36)
if turtles % 2 == 0:
evenlist = evenlist + [t]
else:
oddlist = oddlist + [t]
for times in range(20):
for sides in range(5):
if times % 2==0:
for t in evenlist:
pausedForward(t, 100)
t.turn(90)
else:
for t in oddlist:
pausedForward(t, 100)
t.turn(72)
sleep (0.2)

def pausedForward(turtle ,amount):
sleep (0.2)
turtle.forward(amount)
```

Computer Science & Information Technology

You might also like to view...

The truepart of the IIF function specifies a logical test to conduct on a field of data

Indicate whether the statement is true or false

Computer Science & Information Technology

If no values exist in the logical argument, the AND function returns the #VALUE! error

Indicate whether the statement is true or false

Computer Science & Information Technology