Question: please help with python, Events In this exercise you will extend an existing Turtle program so that it supports additional events. The program is based
please help with python, Events In this exercise you will extend an existing Turtle program so that it supports additional events. The program is based on the example programs in chapter 10 of our textbook. Currently when you run the program it expects you to click to mouse at various locations on the screen and the turtle will draw a line from its last position to the specified point. If you press the q key (lowercase) the program quits. Your job is to extend this program so that it remembers the figure that you create and allows you to redraw it on request. The program also must be able to clear the screen, forget what has been remembered, and switch to a different color theme. Specification: 1. Add a way for the program to remember the point locations that comprise a figure. You might want to use a list of tuples for this purpose. 2. Add a listener for c (Clear) that clears the screen and resets the turtle. (Does not forget the remembered figure.) 3. Add a listener for d (Draw) that draws the figure that has been remembered. 4. Add a listener for f (Forget) that empties/resets the remembered figure. 5. Add a listener for t (Theme) that toggles the current drawing theme (pen color and background) from the initial theme to an alternate them (and toggles back). 6. You can keep using the q listener that quits the program. 7. (Optional, no additional points): Display a list of commands at the top-left of the screen. 8. (Optional, no additional points): Add a listener for u that forgets the last point that was drawn. 9. (Optional, no additional points): Save the remembered figure in a file. Load any remembered figure when the program is started.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
