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...

BO OTP is characterized best by which of the following?

a. It enables computers to broadcast their own IP addresses. b. It enables computers to discover their own MAC addresses. c. It enables computers to discover their own IP addresses. d. It is outdated and no longer used.

Computer Science & Information Technology

The universal selector ____.

A. starts with an asterisk followed by the selector name B. starts with an asterisk C. starts with the # flag D. none of the above

Computer Science & Information Technology

Field ________ are characteristics of a field that control how the field displays and how data is entered in the field

Fill in the blank(s) with correct word

Computer Science & Information Technology

Which security architecture model is based on the premise that higher levels of integrity are more worthy of trust than lower ones?

A. Clark-Wilson B. Bell-LaPadula C. Common Criteria D. Biba

Computer Science & Information Technology