Create a new script where the turtle wanders. To do this the turtle should repeatedly move forward and turn a random amount. Be sure that the turtle can turn both left and right.
Modify the script from the previous activity so that if the turtle reaches the top, bottom, left, or right sides of the screen, it is teleported back to the center. To determine if the turtle has reached an edge of the screen, compare the coordinates of the turtle’s position to the coordinates of the edge of the screen. You can use the actions
turtle→xcor
andturtle→ycor
to get the turtle’s position and the actionsturtle→world width
andturtle→world height
to get the size of the drawing area. To teleport the turtle back to the center, use theturtle→go home
action.
Submission
Please show your source code and run your scripts for the instructor or lab assistant.