Simple for-fun project of the classic snake game implemented in POSIX shell script.
Why not, my friend! Sometimes, you just gotta shell-ebrate simplicity.
- Random fruit generation
- Snake grow longer when eat the fruit
- Full Collition detection
- Simple interface with score counting
- Configurable target FPS
- Zsh
- Bash
- Dash
- Termux
This shell script is designed to be POSIX compatible, following the standards set by the POSIX specification. This means that it should run on any POSIX-compliant shell, which includes most Unix-like systems.
However, while the script adheres to POSIX standards, there are a few commands used that are not guaranteed to be available on all operating systems and you may need to install:
-
bc: The script uses
bc
(basic calculator) for performing precise floating-point arithmetic calculations. Whilebc
is POSIX-defined and commonly available, it might not be installed on some minimal or specialized environments. -
tput: The script uses
tput
to control terminal colors and cursor movement, enhancing the visual aspect of the game. Likebc
,tput
is POSIX-defined but might be missing on certain systems, especially headless or minimal installations.
- Clone the repository.
- Open your terminal and navigate to the directory where the script is located.
- Make sure you have execute permissions for the script:
chmod +x main.sh
. - Run the game:
./main.sh
.
This game is released under the Zero-Clause BSD license. Feel free to use, modify, and distribute this software for any purpose with or without fee. The software comes "as is," and the author disclaims all warranties regarding its use. The author shall not be liable for any damages resulting from the use or performance of this software.