CLICK TO ENLARGE 😇
📄 Description🎓 Objectives
🔨 Tech stack
📂 Files description
💻 Installation and how to use
👷 Authors
Solid Snake is a classic C implementation of the snake game, inspired by this ASMR programming video .
The game features a growing snake that consumes apples while avoiding collisions with itself.
The objective of the project is to create a functional and enjoyable implementation of the classic snake game in C, playable in a Terminal. The scope includes implementing core game mechanics, such as snake movement, apple generation, collision detection and scoring.
The project serves as a confirmation of my C programming skills.
FILE | DESCRIPTION |
---|---|
resources |
Contains the resources required for the repository. |
README.md |
The readme file you are currently reading 😉. |
best_score.c |
Handles reading and writing the best score. |
disable_canonical.c |
Disables canonical mode for Terminal input. |
generate_apple.c |
Generates the apple's position in the game. |
generate_snake.c |
Generates and moves the snake in the game. |
get_keyboard_input.c |
Gets keyboard input for controlling the snake. |
main.c |
Entry point of the program, contains the main loop. |
main.h |
Header file with structure and function prototypes. |
print_game_over.c |
Prints the game over message when the game ends. |
print_game_title.c |
Prints the game title ASCII art. |
print_playground.c |
Prints the playground of the game. |
Instalation:
- Clone this repository:
- Open your preferred Terminal.
- Navigate to the directory where you want to clone the repository.
- Run the following command:
git clone https://github.com/fchavonet/c-solid_snake.git
-
Open the repository you've just cloned.
-
Compile the source code:
gcc *.c -o solid_snake
- Run from your Terminal:
./solid_snake
How to play:
-
QWERTY
- Up:
w
. - Right:
d
. - Down:
s
. - Left:
a
. - Quit:
esc
.
- Up:
-
AZERTY
- Up:
z
. - Right:
d
. - Down:
s
. - Left:
q
. - Quit:
esc
.
- Up:
- Clean and optimize code.
A big thank you to Serene Dev for his ASMR video and to Holberton School for providing a solid foundation in C programming.
Fabien CHAVONET
- Github: @fchavonet