Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 85 additions & 54 deletions turtleRace.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import turtle
from turtle import Turtle, Screen
import random

Expand All @@ -11,60 +12,90 @@

# Ask a question and Enter you input message

Answer = screen.textinput("Question", prompt="Which turtle color will win the race?")

print(Answer)

rainbowColors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet']

Jenny = Turtle()
Jenny.shape("turtle")
Jenny.color("red")
Jenny.penup()
Jenny.goto(-335, 0)

pam = Turtle()
pam.color("orange")
pam.shape('turtle')
pam.penup()
pam.goto(-335, 30)

tom = Turtle()
tom.color("yellow")
tom.shape('turtle')
tom.penup()
tom.goto(-335, 60)

jane = Turtle()
jane.color("green")
jane.shape('turtle')
jane.penup()
jane.goto(-335, 90)

jim = Turtle()
jim.color("blue")
jim.shape('turtle')
jim.penup()
jim.goto(-335, -30)

kim = Turtle()
kim.color("indigo")
kim.shape('turtle')
kim.penup()
kim.goto(-335, -60)

sam = Turtle()
sam.color("violet")
sam.shape('turtle')
sam.penup()
sam.goto(-335, -90)


class Select:
def __init__(self, color, shape, position):
self.color = color
self.shape = shape
self.position = position
# Answer = screen.textinput("Question", prompt="Which turtle color will win the race?")
#
# print(Answer)

rainbowColors = ['red', 'orange', 'yellow', 'green', 'blue', 'indigo']#, 'violet']

userNames = ['jenny', 'pam', 'tom', 'jane', 'jim', 'kim']#, #'sam']

y_Position = [30, 60, 90, 0, -30, -60, -90]

colorTaken = []
nameTaken = []

#
# def changeRange(x, y):
# global num
# for num in range(0, 6):
# num = num + 10
# turtle.goto(-335, num)

for pick in range(0, 6):

userNames = Turtle() # userNames.shape('turtle')
userNames.shape("turtle")
#userNames.color(pick)
userNames.penup()

userNames.goto(-335, y_Position[pick])
userNames.color()
# userNames.goto(changeRange(x, y=num))


# def pickUser():
# for name in userNames:
# name.



# for n in userNames:
# if n in userNames:
# n.goto(-335, 30)

# pam = Turtle()
# pam.color("orange")
# pam.shape('turtle')
# pam.penup()
# pam.goto(-335, 30)
#
# tom = Turtle()
# tom.color("yellow")
# tom.shape('turtle')
# tom.penup()
# tom.goto(-335, 60)
#
# jane = Turtle()
# jane.color("green")
# jane.shape('turtle')
# jane.penup()
# jane.goto(-335, 90)
#
# jim = Turtle()
# jim.color("blue")
# jim.shape('turtle')
# jim.penup()
# jim.goto(-335, -30)
#
# kim = Turtle()
# kim.color("indigo")
# kim.shape('turtle')
# kim.penup()
# kim.goto(-335, -60)
#
# sam = Turtle()
# sam.color("violet")
# sam.shape('turtle')
# sam.penup()
# sam.goto(-335, -90)
#
#
# class Select:
# def __init__(self, color, shape, position):
# self.color = color
# self.shape = shape
# self.position = position


screen.exitonclick()