takshitharao07 / Turtle_Race

Small beginner project

Home Page:https://www.canva.com/design/DAEjrau37Ik/JcQ1uIolSrEr1U3ZNWgPWw/view?utm_content=DAEjrau37Ik&utm_campaign=designshare&utm_medium=link&utm_source=publishsharelink

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Turtle_Race - Survival of the fastest

Turtle_Race_Finished_-_Google_Chrome_2021-07-13_23-44-16_Trim_AdobeCreativeCloudExpress.1.mp4

ALgorithm:

  1. Start.
  2. Import the turtle module.
  3. Import Random module.

__________________________________ START THE TURTLE ___________________________________

  1. Create a new turtle t using turtle() function.
  2. Set turtle speed to ten using speed() function.
  3. Move the turtle from current position to (-140,140). (position can be set accordingly)
  4. Create a variable z and assign value 0 to it .

__________________________________ RACING TRACK ________________________________________

  1. Iterate the for loop 15 times.
  2. Write text at the centre position using the write() function.
  3. Rotate the turtle right by 90 degrees using the right() function.
  4. Move the turtle forward 10 steps using forward function().
  5. Pull back the pendown on screen using the pendown() function.
  6. Move the turtle forward 150 steps.
  7. Move the turtle backward 160 steps.
  8. Rotate the turtle left by 90 degrees using left() function.
  9. Move the turtle forward 25 steps.

________________________ Turtle 1 ________________________

  1. Create a turtle t1.
  2. Pen up.
  3. Move the turtle from its current position to (-160,104).
  4. Change the turtle color to HOT PINK using the color() function.
  5. Set the shape to turtle using shape() function.

________________________ Turtle 2 ________________________

  1. Create a turtle t2.
  2. Repeat the steps 20-23 with its position to(-160,66) and TURQUOISE color

________________________ Turtle 3 ________________________

  1. Create a turtle t3.
  2. Repeat the steps 20-23 with its position to(-160,28) and GOLD color.

________________________ Turtle 4 ________________________

  1. Create a turtle t4.
  2. Repeat the steps 20-23 with its position to (-160,0) and DARK ORCHID color.

__________________________________ WINNER __________________________________

  1. Any of the turtles reaches the coordinates of finish line (220) first, will be declared the winner.
  2. If t1 position is greater than 220 29.1) Print “Pink Turtle won the Race”
  3. If t2 position is greater than 220 30.1) Print “Blue Turtle won the Race”
  4. If t3 position is greater than 220 31.1) Print “Yellow Turtle won the Race”
  5. If t3 position is greater than 220 32.1) Print “Orchid Turtle won the Race”