The "SNAKE" project is a simple version of the classic "Snake" game, written in C. The game displays the snake on the screen, and it moves based on user input (up, down, left, right). The goal is to eat the food that appears on the screen without hitting the walls or yourself.
- Operating System: Windows, Linux, or MacOS
- C Compiler (like GCC)
ncurseslibrary (for text-based graphical interface) - should be installed if not already available
-
Clone the repository:
git clone https://github.com/yourusername/snake.git
-
Navigate to the project directory:
cd snake -
Compile the code:
gcc -o snake snake.c -lncurses
-
Run the game:
./snake
- Use the arrow keys:
Up Arrowto move the snake upDown Arrowto move the snake downLeft Arrowto move the snake leftRight Arrowto move the snake right
- The goal of the game is to eat the food (represented by
*) and grow the snake. Avoid hitting the walls or yourself. - The game ends when the snake hits the wall or itself.
- Basic text-based graphics using the
ncurseslibrary - Dynamic game board management
- Main menu and game-over screen
If you'd like to contribute to the project, feel free to open a Pull Request or submit Issues with suggestions for improvements.
This project is licensed under the MIT License.