Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- tom = Turtle()
- jerry = Turtle()
- tom.color("green")
- jerry.color("blue")
- tom.shape("square")
- jerry.shape("circle")
- tom.penup()
- tom.goto(-250, 100)
- tom.pendown()
- jerry.penup()
- jerry.goto(-250, -100)
- jerry.pendown()
- finish_line = Turtle()
- finish_line.penup()
- finish_line.goto(250, 150)
- finish_line.pendown()
- finish_line.goto(250, -150)
- tom_score = 0
- jerry_score = 0
- from random import randrange
- while tom_score < 500 and jerry_score < 500:
- t = randrange(10, 40)
- j = randrange(10, 40)
- tom.forward(t)
- tom_score = tom_score + t
- jerry.forward(j)
- jerry_score = jerry_score + j
- done()
Add Comment
Please, Sign In to add comment