donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
291 stars 57 forks source link

Turtle history #349

Closed donkirkby closed 2 years ago

donkirkby commented 2 years ago

There are several methods that require each turtle instance to track its own drawing commands: undo(), clear(), clearstamp(), and clearstamps(). clear() seems like it's equivalent to "undo all".

Keep track of the stamp commands in a turtle instance's history, and remove them if requested. stamp() will need to return a stamp id that can be passed to clearstamp(). Check whether the standard implementation tracks a separate list of stamps for each turtle instance. Does clearstamps() clear the stamps of all instances? Note that clearing a stamp removes it from the undo buffer.

How does the undo buffer interact with clearstamp()? Once a stamp falls out of the undo buffer, can it still be cleared?