Question: Exercise 5.3 (navigate3.py) Modify navigate.py so that, rather than take instructions from the command line, it reads from a file (specified by user input) to
Exercise 5.3 (navigate3.py) Modify navigate.py so that, rather than take instructions from the command line, it reads from a file (specified by user input) to determine what the turtle will do. Additionally, you will be adding the "spli" command. This command will use instantiation of new turtles in order to draw multiple lines at once. Every new command will apply to every turtle that currently exists. The file will have on instruction per line. The possible instructions are: forward X Move all turtles forward X. left X Turn all turtles X degrees to the left. right X Turn all turtles X degrees to the right. split X Crea Sample input file: te a new copy of every turtle Each new tu rtle will be turned X degrees to the right. forvard 50 2 left 20 split 40 forard 50 s left 20 6 split 40 7 forward 50 s left 20 9 split 40 o forward 50 left 20 2 split 40 3 forward 50 4 left 20 Sample output: 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
