Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- import random
- #********FIELDS********
- field = turtle.Turtle()
- field.up()
- field.goto(-100,100)
- field.down()
- field.speed(0)
- for i in range(15):
- field.write(i)
- field.right(90)
- field.forward(200)
- field.right(180)
- field.forward(200)
- field.right(90)
- field.forward(25)
- #********FIELDS********
- #********Players********
- #Determine Distance of Player
- x_player1 = 0
- x_player2 = 0
- player1 = turtle.Turtle()
- player1.up()
- player1.color("red")
- player1.shape("turtle")
- player1.goto(-120,60)
- player2 = turtle.Turtle()
- player2.up()
- player2.color("blue")
- player2.shape("turtle")
- player2.goto(-120,30)
- player3 = turtle.Turtle()
- player3.up()
- player3.color("yellow")
- player3.shape("turtle")
- player3.goto(-120,0)
- #********Players********
- win = input ("Which turtle will win:")
- text = turtle.Turtle()
- text.up()
- text.goto(-120,120)
- text.write("You think that the winner will be " + win)
- finishLine = 395
- while True:
- step1 = random.randint(1,5)
- x_player1 = x_player1 + step1
- player1.forward(step1)
- step2 = random.randint(1,5)
- x_player2 = x_player2 + step2
- player2.forward(step1)
- if x_player1 >= finishLine or x_player2 >= finishLine:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement