Mandelbrot viewer in Python and Ruby
- Ruby 75.5%
- Python 24.5%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| mandy.py | ||
| mandy.rb | ||
| README | ||
| tc_mandy.rb | ||
Here are the latter two of three incarnations of an old project of mine. Years ago, I wrote a simple text-based Mandelbrot Set viewer in C. Later, while learning Python, I discovered it had an excellent curses library, and set about to make a fancy version of my Mandelbrot Set viewer, with color "graphics" made possible by the extended ASCII shaded block characters. The original Mandy was born. Recently, I took up learning Ruby, as well as trying to get into the habit of test-driven development. This, combined with the fact that I seemed to have lost both previous incarnations of this program, prompted me to re-implement Mandy from the ground up in Ruby. (After completing the Ruby version, I happily found the original Python code, and have now added it to this repository as mandy.py) As I'm relatively new to both Ruby and TDD, I'm sure there is some room for improvement here. Particularly in light of the fact that TDD went out the window once I started working on the actual curses frontend, since console I/O isn't exactly the sort of thing one can easily unit test. I am also somewhat dissapointed that I could not figure out a way to display the shaded block characters consistently. Linux doesn't seem to be very consistent about how it displays these characters, and when I attempted to use them, the X terminal and the console each came out different shades of wrong. Come to think of it, the last time the Python version worked as I envisioned it was on a circa 2002 version of Mandrake Linux. I was going for the aesthetic of the ANSI art games from an early 1990s Wildcat! BBS, but I guess that's just a bit too DOS-y for Linux. The controls are fairly simple: arrow keys move you around, PgUp zooms in, PgDn zooms out. Press 'q' to quit. Enjoy!