This is a classic Snake game implemented in C. It's a simple yet entertaining console-based game where the player controls a snake that grows longer as it consumes food.
- Clone or download the repository.
- Compile the code using a C compiler, e.g.,
gcc snake_game.c -o snake_game
. - Run the game with
./snake_game
(on Unix-based systems) orsnake_game.exe
(on Windows).
- Use the arrow keys to control the direction of the snake:
- Up:
↑
- Down:
↓
- Left:
←
- Right:
→
- Up:
- The snake starts with a length of one.
- Move the snake to collect food (green circles).
- The snake grows in size when it eats food.
- Try to achieve the highest score by eating as much food as possible without colliding with yourself.
This Snake Game in C is open-source and available under the MIT License. You are free to use and modify the code for your purposes.
Happy gaming! 🐍