Skip to content

A classic C implementation of snake game in a Terminal. Features snake movement, apple generation, collision detection and scoring. Confirms C programming skills.

Notifications You must be signed in to change notification settings

fchavonet/c-solid_snake

Repository files navigation

C logo

Solid Snake

🔖 Table of contents

CLICK TO ENLARGE 😇 📄 Description
🎓 Objectives
🔨 Tech stack
📂 Files description
💻 Installation and how to use
♥️ Thanks
👷 Authors

📝 Description

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.

🎓 Objectives

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.

🔨 Tech stack

C badge Shell Script badge

📂 Files description

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.

💻 Installation and how to use

Instalation:

  1. 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
  1. Open the repository you've just cloned.

  2. Compile the source code:

gcc *.c -o solid_snake
  1. Run from your Terminal:
./solid_snake

How to play:

  1. QWERTY

    • Up: w.
    • Right: d.
    • Down: s.
    • Left: a.
    • Quit: esc.
  2. AZERTY

    • Up: z.
    • Right: d.
    • Down: s.
    • Left: q.
    • Quit: esc.

🔧 What's next ?

  • Clean and optimize code.

♥️ Thanks

A big thank you to Serene Dev for his ASMR video and to Holberton School for providing a solid foundation in C programming.

👷 Authors

Fabien CHAVONET

About

A classic C implementation of snake game in a Terminal. Features snake movement, apple generation, collision detection and scoring. Confirms C programming skills.

Topics

Resources

Stars

Watchers

Forks

Languages