AllenDowney / ThinkPython2

LaTeX source and supporting code for Think Python, 2nd edition, by Allen Downey.
Other
2.49k stars 1.65k forks source link

next iteration of grid.py #85

Open jerryu opened 3 years ago

jerryu commented 3 years ago

At present, grid.py has two iterations via the "exploratory process".

I wonder if another iteration would help future readers continue discerning the patterns.
Recognizing the grid as rows of repeated patterns, one may be able to restructure the code using a generalized 'row'.

By 'generalized row', I meant each row differs from each other, only by marker ('+' or '|') and filler('-' or ' '), hence its drawing can be encapsulated into one function with marker and filler as parameters.

jerryu commented 3 years ago

A pull request (https://github.com/AllenDowney/ThinkPython2/pull/86) has been submitted to illustrate the abstraction of a generalized row. any thoughts?