Question: Modify the program below from ( Jupyter Notebook robot simulator Robolab ) so it draws the pattern on picture: % % sim _ magic _
Modify the program below from Jupyter Notebook robot simulator Robolab
so it draws the pattern on picture:
simmagicpreloaded p pencolor green a
SIDES
# Try to draw a square
STEERING
TURNROTATIONS
TURNSPEED
STRAIGHTSPEEDPC SpeedPercent
STRAIGHTROTATIONS
def drawsquaresideSTRAIGHTROTATIONS:
Draw square of specified side length."""
for sidenumber in rangeSIDES:
# Go straight
# Set the left and right motors in a forward direction
# and run for the number of rotations specified by: side
tankdrive.onforrotationsSTRAIGHTSPEEDPC
STRAIGHTSPEEDPC
# Use provided side length
side
# Slight graceful turn to lef
tankdrive.onforrotationsSpeedPercent SpeedPercent
#Turn
# Set the robot to turn on the spot
# and run for a certain number of rotations of the wheels
tankturn.onforrotationsSTEERING
SpeedPercentTURNSPEED
TURNROTATIONS
# Call the function to draw a small size square
drawsquare
# And an even smaller square
drawcircle
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
