Update README.md

This commit is contained in:
Arkaprabha Chakraborty
2022-05-18 11:13:02 +05:30
parent 52108eedca
commit 45fc363b3f

View File

@@ -1,6 +1,6 @@
# 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](https://www.a1k0n.net/2011/07/20/donut-math.html).
Puts a spinning ASCII torus (mathematical name for a doughnut-shaped object) on the terminal. Original post by Andy Sloane can be found [here](https://www.a1k0n.net/2011/07/20/donut-math.html).
# How to run
@@ -10,57 +10,46 @@ Prints a spinning ASCII torus (mathematical name for a doughnut-shaped object) o
# For Windows
## Prerequisites for Windows 10 or Windows 11
## Prerequisites for Windows
* Install a compiler like [GCC](https://gcc.gnu.org/) or [Clang](https://clang.llvm.org/) for the C version
* Install [Python](https://www.python.org/) for the Python version
## How to run the Python version
* Type `python doughnut.py` in the shell to run the Python version
* Type `python torus.py` in the shell to run the Python version
## How to compile or build the C version
## How to build and run 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
* Type `gcc -o torus torus.c -lm` in the shell to compile using GCC
* Type `clang -o torus torus.c -lm` in the shell to compile using Clang
* Type `.\torus` in the shell to run the program
# For Linux
## Prerequisites for Debian based distros
## Prerequisites for Debian based distributions
* `sudo apt install make` to install Make
* `make deb` to install the required compilers
* `sudo apt install python3 gcc` to install the required compilers
## Prerequisites for Arch based distros
## Prerequisites for Arch based distributions
* `sudo pacman -S make` to install Make
* `make arch` to install the required compilers
* `sudo pacman -S python3 gcc` to install the required compilers
## How to compile C version
## How to compile and run C version
* `make build` to compile the C version
* `gcc -o torus torus.c -lm` to compile the C version
* `./torus` to run the C version
## How to run the programs
## How to run the Python version
* `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
* `python3 torus.py` in the shell to run the Python version
## How to clean up the C executable
* `make clean` to clean up after execution
# Updates
# Updates to the C version
* Added support for dynamic resolution based on current terminal size
* Added Windows support
* Added support for on the fly dynamic resolution
* Added support for on-the-fly dynamic resolution
* Added help option to the program
# Screenshot