Question: e. Create a function that will allow your robot to draw something that approximates an equilateral triangle when in pen down mode. Your function

e. Create a function that will allow your robot to draw something

e. Create a function that will allow your robot to draw something that approximates an equilateral triangle when in pen down mode. Your function should accept at least one parameter to define the edge length of the triangle. Write a program that makes use of your function to draw a triangle, drive forwards away from the triangle, and then draw a second triangle with a side length half that of the first triangle. Finally, the robot should drive clear of the second triangle. Figure 1 shows an example of the sort of output we would expect to see. Figure 1 Example of desired output for part (e) Run your code using the following simulator setup magic: %%sim_magic_preloaded -- autorun - Cp -b Empty_Map -x 100 -y 700 -a -90 Your answer should include your code and a screenshot of the simulator after running the code. (8 marks)

Step by Step Solution

3.42 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The Python code for the function and the program to draw the triangles im... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!