Skip to content

erik-adelbert/donut

Repository files navigation

Donut

A terminal donut animation and ASCII art CLI written in Go, built with Charm's Bubble Tea and Lip Gloss TUI libraries.

Demo

Donut Demo

Note on GPU-Accelerated Terminals

For the best animation experience, use a GPU-accelerated terminal emulator such as Alacritty, Kitty, or similar. While not required, these terminals can provide smoother and more vibrant visuals for the donut animation.

Table of Contents

Requirements

Features

  • Real-time optimized 3D simulation based on sloane's rotating donut
  • Colorful, animated terminal output for modern terminal emulators
  • 🚀 Emoji render mode
  • Hardwired 60FPS ASCII rendering on most computers
  • 300μs allocation free core loop (Apple Silicon M1)

Usage

Clone

git clone https://github.com/erik-adelbert/donut.git
cd donut

Run with Makefile

make run

Build the executable:

make build
./bin/donut

Install with go install

go install github.com/erik-adelbert/donut/cmd/donut@latest

Test and benchmark

make test
make bench

Run without Makefile

go run ./cmd/donut/main.go

Build a binary:

mkdir -p bin
go build -o bin/donut ./cmd/donut/main.go
./bin/donut

Dependencies

Project Structure

  • cmd/donut/ — CLI entry point (main package)
  • donut/ — Core simulation and rendering logic

How it Works

  • The model rotate and project a donut onto the screen. This work is a careful port of sloane's 2006 IOCCC entry, donut.c

Customization

  • Adjust the palette in donut/palette.go to change the donut appearance.
  • Change the simulation parameters as needed.

License

MIT. See LICENSE.

Author

Erik Adelbert

Note: I don't need to vibe my code. This project is crafted.

About

A high-performance donut animation for the terminal, written in Go with Bubble Tea and Lip Gloss.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors