Your instructor may assign one or more of the following problems. Don’t feel that you must do all the problems; for the homeworks, you are only required to do those that are explicitly assigned via Moodle.
turtle_directions.py that
prompts the user for a file name containing directions for a turtle,
and then uses turtle graphics to execute the directions. The file of
directions will have one command per line. Valid command formats are
as follows:
color_namecolor_name is one of green, red,
pink, purple, black or blueNOTE: The "point" should be drawn using the turtle method dot.
NOTE: a line may have extra spaces at the beginning or end.
Include with your submission a sample file of directions that
uses each command at least once.
Extend your circle class from the previous homework in the following ways.
circle.py solution and
modify it so that the testing code at the bottom of the file,
outside of the class definition, is not run when the circle module
is loaded by other programs.
circles.txt,
that contains specifications for circle objects of the following
form:
Note that each row provides the values required to specify a new circle object.0 0 100 black unfilled 100 0 10 gold filled 130 20 20 blue filled
circle_driver.py program that imports
the circle module, reads the contents of circles.txt,
creates a list of circles as specified and draws them using the
turtle.
circle_write.py program that writes a
set of hard-coded circle specifications to the circles.txt
file.
With these things in place, you should be able to run circle_write.py
to create a new circles.txt file and then run circle_driver.py
to print those circles using the Python turtle.
Extend your rectangle class from the previous homework in the following ways.
rectangle.py solution and
modify it so that the testing code at the bottom of the file,
outside of the class definition, is not run when the circle module
is loaded by other programs.
rectangles.txt,
that contains specifications for rectangle objects of the following
form:
Note that each row provides the values required to specify a new rectangle object.0 0 100 50 black 100 0 10 50 gold 130 20 20 50 blue
rectangle_driver.py program that imports
the rectangle module, reads the contents of rectangles.txt,
creates a list of rectangles as specified and draws them using the
turtle.
rectangle_write.py program that writes a
set of hard-coded circle specifications to the rectangles.txt
file.
With these things in place, you should be able to run rectangle_write.py
to create a new rectangles.txt file and then run rectangle_driver.py
to print those rectangles using the Python turtle.
Submit all appropriate files for grading, including code files, screen captures, supplemental files (e.g., image files), and text files. We will grade this exercise according to the following criteria: