From the course: Python Practice: Real-World Coding Challenges

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Solution: Extending the scribe

Solution: Extending the scribe

(upbeat music) - [Instructor] I went a little overboard with my solution and made four new classes, one that extends the canvas and three that extend TerminalScribe. So the first is CanvasAxis. When you use a CanvasAxis instead of a regular canvas, it will add an X and Y axis to the plot. Currently, this handles numbers up to two digits to the axis, but it could easily be extended if your monitor is much larger than mine. Then I pulled out the code for the plotting functions, and also moving up down left right into a sort of RobotScribe. These are pretty straightforward, no custom constructors or anything. It's just a good way to keep these functions organized and separate from the sort of core functions of the parent terminal scribe class. And finally, I added a RandomWalkScribe. This does have its own constructor here because it has an additional parameter. And that is the current direction, well, the initial…

Contents