The August 2016 COhPy challenge
A pdf of of the original Computer Recreations column on which this chapter is based can be found here.
I have implemented one of those algorithms, John E. Connett's "CIRCLE^2" in the Python program circle2.py.
The challenge this month is to refactor this program to:
Can you make the program better at accepting input? What should it do if you input bad data?
Can you document the program better?
Can you make the program faster?
Can you use generators to generate the plot?
Can you write tests for the program?
As a bonus, are there good inputs that result in pretty pictures? Here are two:
- -15 -20 87
- -15 -20 9
- -4506 21539 3.12
As another bonus, can you add color? (HINT: the c%2 is a binary check (even/odd, white/black)).
As another bonus, play with different algorithms, and be able to choose them from the command line.
See HOWTO-SUBMIT-ENTRY.md for how to submit an entry.