Close Show/hide page

{zero point nine} personal experiments, etc.

Hello Rust (ASCII fractals in the terminal)

Again, as a way of learning a new language, I've written a Mandelbrot set visualizer. I'm really liking the language Rust so far. I hope it succeeds.

To keep the focus on learning language features and avoid getting sidetracked by the various ins-and-outs of some random graphics API, I went for an ASCII style approach for the visuals, outputting to the terminal.

A few things of note:

  • The fractal data is generated on multiple threads, which makes it possible to navigate deeper into the Mandelbrot set in realtime.
  • Julia is also supported, and notably, the program morphs between Julia sets by tweening the seed value.
  • Given the limited 'dynamic range' of ASCII-style output, I added a kind of 'auto-exposure' logic as an experiment, which enhances the appearance of the text output considerably.
  • As with the previous Scala version, I developed the beginnings of an animator/tweener class in order to animate everything possible (though I'd like to make this more ergonomic in the future).
  • Rotation is supported

Last updated: 2016/3/3

View or post a comment