https://github.com/samyak2/donut
Rendering a donut in the terminal using Go and some math
https://github.com/samyak2/donut
donut go golang unicode
Last synced: 4 months ago
JSON representation
Rendering a donut in the terminal using Go and some math
- Host: GitHub
- URL: https://github.com/samyak2/donut
- Owner: Samyak2
- License: mit
- Created: 2021-05-30T14:33:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-30T14:34:02.000Z (over 4 years ago)
- Last Synced: 2025-06-01T17:03:14.520Z (5 months ago)
- Topics: donut, go, golang, unicode
- Language: Go
- Homepage:
- Size: 2.95 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# donut
Rendering a donut in the terminal using Go and some math.
Idea, math and code stolen from [this excellent article](https://www.a1k0n.net/2011/07/20/donut-math.html)

^ this was recorded with a terminal size of `120x240`. On a saner terminal, this will look much more pixelated.
## Why?
- fun
## Improvements
Some improvements from the original in the article:
- Unicode rendering - uses the [Unicode full block (U+2588)](https://www.compart.com/en/unicode/U+2588) instead of ASCII characters for better looking renders
- Colors: [256-bit terminal colors](https://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html#256-colors) are used for better looking grayscale as well as colored donuts!
- Documented and configurable## Usage
- 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!## TODO
- expose configurable parameters as command-line flags
- other shapes?