Your (turtle) program in python must include: Create four Red turtles and four Blue turtles using...

80.2K

Verified Solution

Question

Programming

Your (turtle) program in python must include: Create four Redturtles and four Blue turtles using one or more lists. • Start eachof the Red turtles at a different random location on the left sideof the screen within the range of the square formed by (-100, 100)and (0, -100) and each of the Blue turtles at a random location onthe right side of the screen within the range of the square formedby (0, 100) and (100, -100). • Each of the red and blue turtlesshould move randomly. • Draw a boundary for the game as a circlewith a 300 unit radius. You will use an invisible turtle to dothis. It does not count as one of the turtles on either team. • Ifa turtle hits the border the turtle should have its color changedto black and should jump back to the center of the screen (0, 0)and continue moving. • All the turtles will move the same speed. •The turtles should continue moving until 1000 time units haveelapsed.

Answer & Explanation Solved by verified expert
4.5 Ratings (991 Votes)
Codeimport randomimport pandas as pdimport mathblueturtle blue1 0 0 blue blue2 0 0 blue blue3 0 0 blue blue4 0 0 blueredturtle red1 0 0 red red2 0 0 red red3 0 0 red red4 0 0 redreddata pdDataFrameredturtle columns RTurtX Y Color Red Turtles dataframebluedata pdDataFrameblueturtle columns BTurtX Y Color Blue Turtles dataframe Initial coordinate generator for blue turtlesfor k in bluedataBTurt bluedatalocbluedataBTurt k X randomchoicesrange0100 bluedatalocbluedataBTurt k Y randomchoicesrange1000    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students