2022-05-18 11:12:45 +05:30
2022-02-05 00:45:06 +05:30
2022-04-07 16:41:04 +05:30
2022-05-18 11:09:17 +05:30
2022-01-05 22:58:39 +05:30
2022-02-14 10:38:39 +05:30
2022-02-14 11:11:29 +05:30
2022-05-18 11:11:54 +05:30
2022-05-18 11:12:45 +05:30

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

  • Install a compiler like GCC or Clang for the C version
  • Install Python for the Python version

How to run the Python version

  • Type python doughnut.py in the shell to run the Python version

How to compile or build the C version

  • Type gcc -o doughnut.exe doughnut.c -lm in the shell to compile using GCC
  • Type clang -o doughnut.exe doughnut.c -lm in the shell to compile using Clang

How to run the C version

  • Type .\doughnut.exe in the shell to run the program
  • Type .\doughnut.exe --enable-dynamic-resolution or .\doughnut.exe -d in 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 make to install Make
  • make deb to install the required compilers

Prerequisites for Arch based distros

  • sudo pacman -S make to install Make
  • make arch to install the required compilers

How to compile C version

  • make build to compile the C version

How to run the programs

  • make run-c to run the C version
  • make run-cd to run the C version with dynamic resolution enabled
  • make run-py to run the Python version

How to clean up the C executable

  • make clean to 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

Screenshot

Description
Spinning ASCII donut on the terminal.
Readme MIT 883 KiB
Languages
C 98.3%
Makefile 1.7%