38aa82792a7c3d2e21d95d050e56bf877a0a76b9
Description
Prints a spinning ASCII torus (mathematical name for a doughnut-shaped object) on the terminal. Original post by Andy Sloane can be found here.
How to run
- Clone or download and extract the repository
- Open a terminal inside the project directory
- Follow the steps for your Operating System
For Windows
Prerequisites for Windows 10 or Windows 11
How to run the Python version
- Type
python doughnut.pyin the shell to run the Python version
How to compile or build the C version
- Type
gcc -o doughnut.exe doughnut.c -lmin the shell to compile using GCC - Type
clang -o doughnut.exe doughnut.c -lmin the shell to compile using Clang
How to run the C version
- Type
.\doughnut.exein the shell to run the program - Type
.\doughnut.exe --enable-dynamic-resolutionor.\doughnut.exe -din the shell to run the program with dynamic resolution enabled - You can also double-click on the executable (a.k.a. a dot-exe file) to run it
For Linux
Prerequisites for Debian based distros
sudo apt install maketo install Makemake debto install the required compilers
Prerequisites for Arch based distros
sudo pacman -S maketo install Makemake archto install the required compilers
How to compile C version
make buildto compile the C version
How to run the programs
make run-cto run the C versionmake run-cdto run the C version with dynamic resolution enabledmake run-pyto run the Python version
How to clean up the C executable
make cleanto clean up after execution
Updates
- Added support for dynamic resolution based on current terminal size
- Added Windows support
- Added support for on the fly dynamic resolution
Screenshot
Languages
C
98.3%
Makefile
1.7%
