Download the code in this chapter from http://thinkpython.com/code/polygon.py.
- Write appropriate docstrings for
- Draw a stack diagram that shows the state of the program while executing
circle(bob, radius). You can do the arithmetic by hand or add
- The version of
arcin Section 4.7 is not very accurate because the linear approximation of the circle is always outside the true circle. As a result, the turtle ends up a few units away from the correct destination. My solution shows a way to reduce the effect of this error. Read the code and see if it makes sense to you. If you draw a diagram, you might see how it works.
Write an appropriately general set of functions that can draw flowers as in Figure 4.12.1.
Write an appropriately general set of functions that can draw shapes as in Figure 4.12.2.
The letters of the alphabet can be constructed from a moderate number of basic elements, like vertical and horizontal lines and a few curves. Design a font that can be drawn with a minimal number of basic elements and then write functions that draw letters of the alphabet.
You should write one function for each letter, with names
draw_b, etc., and put your functions in a file named
letters.py. You can download a “turtle typewriter” from http://thinkpython.com/code/typewriter.py to help you test your code.