This repository contains a collection of simple terminal-based games written in C:
- SkyWars (
skywars.c) - Snake (
snake.c) - Tic-Tac-Toe (
tictactoe.c) - Main Screen Launcher (
main-screen.c)
.
├── Makefile
├── README.md
└── src
├── skywars.c
├── snake.c
├── tictactoe.c
└── main-screen.c
- GCC (GNU Compiler Collection)
- Linux/macOS terminal (POSIX compatible)
- No additional libraries required
The project uses a Makefile for compilation. By default, the source files are in ./src/.
To compile all games:
makeThis will generate:
./src/game_skywars./src/game_snake./src/game_tictactoemain-screen(executable launcher)
Note:
makeruns the defaultinstallationtarget.
To clean compiled binaries:
make cleanThis removes the
./srcfolder, so only the source files remain.
- From source folder:
./src/game_skywars
./src/game_snake
./src/game_tictactoe- Or using the main screen launcher:
./main-screenThis launcher allows you to choose and play any of the available games.
W / w→ UpS / s→ DownA / a→ LeftD / d→ Right
Q W E→ Top rowA S D→ Middle rowZ X C→ Bottom rowSpace→ Change value of a selected cellEnter→ Submit the chosen cell value
- Terminal must support ANSI escape codes for colors and cursor control.
- Ctrl+C will safely exit any game and restore the terminal state.
- Games are designed for single-player experience; Tic-Tac-Toe includes a basic opponent AI.