Skip to content

Dheovani/ConsoleSnakeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game in C

Gameplay

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.

How to Play

  1. Clone or download the repository.
  2. Compile the code using a C compiler, e.g., gcc snake_game.c -o snake_game.
  3. Run the game with ./snake_game (on Unix-based systems) or snake_game.exe (on Windows).

Controls

  • Use the arrow keys to control the direction of the snake:
    • Up:
    • Down:
    • Left:
    • Right:

Gameplay

  • 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.

License

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! 🐍