screen = turtle.Screen() screen.title("Trivia Turtle Race") screen.bgcolor("white") finish_line = turtle.Turtle() finish_line.speed(0) finish_line.color("black") p1, p2, p3 = create_players() players = [p1, p2, p3] questions = [ Question("What is the largest mammal?", {1: "Whale", 2: "Lion", 3: "Orca", 4: "Wolf"}, 1), Question("What is the name of the planet that is closest to the sun?", {1: "Jupiter", 2: "Mars", 3: "Mercury", 4: "Saturn"}, 3), Question("What is the capital of the United States?", {1: "Washington D.C.", 2: "Philadelphia", 3: "New York", 4: "Texas"}, 1), Question("What is 28 divided by 7?", {1: "6", 2: "7", 3: "2", 4: "4"}, 4), Question("How many inches are in 1 foot?", {1: "6", 2: "12", 3: "10", 4: "5"}, 2), Question("Who discovered the laws of gravity?", {1: "Isaac Newton", 2: "Albert Einstein", 3: "Galileo", 4: "Charles Darwin"}, 1), Question("How many teeth does an adult have?", {1: "24", 2: "45", 3: "32", 4: "39"}, 3), Question("When do we celebrate Independence Day?", {1: "September 18", 2: "December 25", 3: "June 18", 4: "July 4"}, 4), Question("Which ocean is located on the west coast of North America?", {1: "Atlantic Ocean", 2: "Pacific Ocean", 3: "Arctic Ocean", 4: "Indian Ocean"}, 2), Question("Who was the second president of the United States?", {1: "George Washington", 2: "John Adams", 3: "Thomas Jefferson", 4: "Abraham Lincoln"}, 2), Question("What is the 3rd planet from the sun?", {1: "Mercury", 2: "Pluto", 3: "Earth", 4: "Moon"}, 3), Question("What do you call a baby cow?", {1: "Calf", 2: "Cub", 3: "Joey", 4: "Puppy"}, 1), Question("How many legs does a spider have?", {1: "4", 2: "7", 3: "5", 4: "8"}, 4), Question("How many stripes are on the American Flag?", {1: "10", 2: "13", 3: "15", 4: "17"}, 2), Question("How many planets are in our solar system?", {1: "4", 2: "6", 3: "8", 4: "10"}, 3), Question("Where is the leaning tower of Piza?", {1: "Italy", 2: "Paris", 3: "Argentina", 4: "Greece"}, 1), Question("How many days are in a year?", {1: "286", 2: "312", 3: "345", 4: "365"}, 4), Question("How many colors are in a rainbow?", {1: "4", 2: "7", 3: "8", 4: "10"}, 2), Question("What is the largest state in the United States?", {1: "Texas", 2: "Florida", 3: "Alaska", 4: "California"}, 3), Question("What is the largest continent?", {1: "Asia", 2: "Europe", 3: "North America", 4: "Australia"}, 1), Question("Who became the 50th US state?", {1: "Alaska", 2: "Hawaii", 3: "Wyoming", 4: "North Dakota"}, 2), Question("How much is a half dozen?", {1: "4", 2: "5", 3: "7", 4: "6"}, 4), Question("How many quarts in a gallon?", {1: "4", 2: "5", 3: "3", 4: "8"}, 1), Question("How many dimes make a dollar?", {1: "5", 2: "7", 3: "10", 4: "12"}, 3), Question("What is the smallest state in the US?", {1: "Delaware", 2: "New Jersey", 3: "Utah", 4: "Rhode Island"}, 4), ]
screen = turtle.Screen()
screen.title("Trivia Turtle Race")
screen.bgcolor("white")
finish_line = turtle.Turtle()
finish_line.speed(0)
finish_line.color("black")
p1, p2, p3 = create_players()
players = [p1, p2, p3]
questions = [
Question("What is the largest mammal?", {1: "Whale", 2: "Lion", 3: "Orca", 4: "Wolf"}, 1),
Question("What is the name of the planet that is closest to the sun?", {1: "Jupiter", 2: "Mars", 3: "Mercury", 4: "Saturn"}, 3),
Question("What is the capital of the United States?", {1: "Washington D.C.", 2: "Philadelphia", 3: "New York", 4: "Texas"}, 1),
Question("What is 28 divided by 7?", {1: "6", 2: "7", 3: "2", 4: "4"}, 4),
Question("How many inches are in 1 foot?", {1: "6", 2: "12", 3: "10", 4: "5"}, 2),
Question("Who discovered the laws of gravity?", {1: "Isaac Newton", 2: "Albert Einstein", 3: "Galileo", 4: "Charles Darwin"}, 1),
Question("How many teeth does an adult have?", {1: "24", 2: "45", 3: "32", 4: "39"}, 3),
Question("When do we celebrate Independence Day?", {1: "September 18", 2: "December 25", 3: "June 18", 4: "July 4"}, 4),
Question("Which ocean is located on the west coast of North America?", {1: "Atlantic Ocean", 2: "Pacific Ocean", 3: "Arctic Ocean", 4: "Indian Ocean"}, 2),
Question("Who was the second president of the United States?", {1: "George Washington", 2: "John Adams", 3: "Thomas Jefferson", 4: "Abraham Lincoln"}, 2),
Question("What is the 3rd planet from the sun?", {1: "Mercury", 2: "Pluto", 3: "Earth", 4: "Moon"}, 3),
Question("What do you call a baby cow?", {1: "Calf", 2: "Cub", 3: "Joey", 4: "Puppy"}, 1),
Question("How many legs does a spider have?", {1: "4", 2: "7", 3: "5", 4: "8"}, 4),
Question("How many stripes are on the American Flag?", {1: "10", 2: "13", 3: "15", 4: "17"}, 2),
Question("How many planets are in our solar system?", {1: "4", 2: "6", 3: "8", 4: "10"}, 3),
Question("Where is the leaning tower of Piza?", {1: "Italy", 2: "Paris", 3: "Argentina", 4: "Greece"}, 1),
Question("How many days are in a year?", {1: "286", 2: "312", 3: "345", 4: "365"}, 4),
Question("How many colors are in a rainbow?", {1: "4", 2: "7", 3: "8", 4: "10"}, 2),
Question("What is the largest state in the United States?", {1: "Texas", 2: "Florida", 3: "Alaska", 4: "California"}, 3),
Question("What is the largest continent?", {1: "Asia", 2: "Europe", 3: "North America", 4: "Australia"}, 1),
Question("Who became the 50th US state?", {1: "Alaska", 2: "Hawaii", 3: "Wyoming", 4: "North Dakota"}, 2),
Question("How much is a half dozen?", {1: "4", 2: "5", 3: "7", 4: "6"}, 4),
Question("How many quarts in a gallon?", {1: "4", 2: "5", 3: "3", 4: "8"}, 1),
Question("How many dimes make a dollar?", {1: "5", 2: "7", 3: "10", 4: "12"}, 3),
Question("What is the smallest state in the US?", {1: "Delaware", 2: "New Jersey", 3: "Utah", 4: "Rhode Island"}, 4),
]
play_game()
turtle.done()
The code given is the last of the code in the attached images. I am having trouble with repeating questions and making the players start on the left side of the screen.
Step by step
Solved in 5 steps with 18 images