Git Product home page Git Product logo

challenge-201608-refactor's Introduction

The August 2016 COhPy challenge

In A.K. Dewdney's book, "The Armchair Universe", there is a chapter called "Wallpaper for the Mind". In it, he describes a number of algorithms to make pretty pictures.

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:

  1. Can you make the program better at accepting input? What should it do if you input bad data?

  2. Can you document the program better?

  3. Can you make the program faster?

  4. Can you use generators to generate the plot?

  5. Can you write tests for the program?

As a bonus, are there good inputs that result in pretty pictures? Here are two:

  1. -15 -20 87
  2. -15 -20 9
  3. -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 howto submit an entry.

challenge-201608-refactor's People

Contributors

efloehr avatar james-prior avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.