(PLEASE READ CAREFULLY)- Hi, can you change the colour of my turtles to blue, re
ID: 3876425 • Letter: #
Question
(PLEASE READ CAREFULLY)- Hi, can you change the colour of my turtles to blue, red, black, yellow and green using Turtle from python to my program bellow These are the colours of the olympic rings. I need five turtles on the program. Also, have a countdown of “READY” “SET” “GO” appear on the screen and then the turtles take off. And add this: WHEN THE USER CHOOSES TO EXIT - DISPLAY A NEW SCREEN AND TELL THEM HOW MANY TIMES EACH TURTLE WON THE RACE AND HOW MANY TIMES THEY GUESSED RIGHT. AND ADD A OLYMPIC FLAG AT THE TOP OF THE SCREEN –MUST HAVE A WHITE BACKGROUND AND THE 5 COLOURED RINGS THAT WILL APPEAR ON THE FLAG. Add all these requirements to my program. Thanks.
PROGRAM:
#!/bin/python3
from turtle import *
from random import randint
import time
speed(0)
penup()
goto(-140, 140)
for step in range(15):
write(step, align='center')
right(90)
for num in range(8):
penup()
forward(10)
pendown()
forward(10)
penup()
backward(160)
left(90)
forward(20)
ada = Turtle()
ada.color('blue')
ada.shape('turtle')
ada.penup()
ada.goto(-160, 100)
ada.pendown()
for turn in range(10):
ada.right(36)
bob = Turtle()
bob.color('red')
bob.shape('turtle')
bob.penup()
bob.goto(-160, 75)
bob.pendown()
for turn in range(72):
bob.left(5)
ivy = Turtle()
ivy.shape('turtle')
ivy.color('black')
ivy.penup()
ivy.goto(-160, 50)
ivy.pendown()
for turn in range(60):
ivy.right(6)
jim = Turtle()
jim.shape('turtle')
jim.color('yellow')
jim.penup()
jim.goto(-160, 25)
jim.pendown()
for turn in range(30):
jim.left(12)
ele = Turtle()
ele.shape('turtle')
ele.color('green')
ele.penup()
ele.goto(-160, 5)
ele.pendown()
for turn in range(15):
ele.right(24)
# turtle which keeps score
scorer = Turtle()
scorer.color("red")
scorer.speed(0)
scorer.penup()
scorer.goto(-80,70)
f=("Arial",25,"normal")
# turtle which keeps winner
winner = Turtle()
winner.color("black")
winner.speed(0)
winner.penup()
winner.goto(-80,70)
f=("Arial",15,"normal")
# count down to start
for countdown in ["READY","SET","GO"]:
scorer.write(countdown,font=f)
time.sleep(1)
scorer.clear()
for turn in range(100):
ada.forward(randint(1,5))
bob.forward(randint(1,5))
ivy.forward(randint(1,5))
jim.forward(randint(1,5))
ele.forward(randint(1,5))
Explanation / Answer
import turtle
import time
wn=turtle.Screen()
black = turtle.Turtle()
black.speed(99999999999999999999999)
black.pensize(11)
black.color("butts")
black.circle(50)
red = turtle.Turtle()
red.speed(99999999999999999999999)
red.pensize(11)
red.color("red")
red.penup()
red.forward(128)
red.pendown()
red.circle(50)
b = turtle.Turtle()
b.speed(999999999999999999)
b.pensize(11)
b.color("blue")
b.penup()
b.backward(128)
b.pendown()
b.circle(50)
g = turtle.Turtle()
g.speed(99999999999999999999999999999999999)
g.pensize(11)
g.color("green")
g.penup()
g.forward(14)
g.right(90)
g.pendown()
g.circle(50)
y = turtle.Turtle()
y.speed(9999999999999999999999999999999999)
y.pensize(11)
y.color("yellow")
y.penup()
y.backward(114)
y.right(90)
y.pendown()
y.circle(50)
time.sleep(.5)
print "Yay!"
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.