Rendering a donut in the terminal using Go and some math.
Idea, math and code stolen from this excellent article
^ this was recorded with a terminal size of 120x240
. On a saner terminal, this will look much more pixelated.
- fun
Some improvements from the original in the article:
- Unicode rendering - uses the Unicode full block (U+2588) instead of ASCII characters for better looking renders
- Colors: 256-bit terminal colors are used for better looking grayscale as well as colored donuts!
- Documented and configurable
- Clone this repo and
cd
into it go run .
- Change some of the configuration (in
donut.go
) and play with it - Look at it go!
- expose configurable parameters as command-line flags
- other shapes?