Skip to content

softwareDesignAndTesting/snake-cli

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Snake Game ๐Ÿ

A feature-rich console Snake game with scoring, difficulty scaling, poisonous food, pause functionality, and high score tracking.

Features โœจ

  • ๐ŸŽ Food System: Eat food to grow and increase score (+10 points)
  • โ˜ ๏ธ Poisonous Food: Avoid poison or game over!
  • ๐Ÿ“ˆ Dynamic Difficulty: Speed increases as you score more
  • โธ๏ธ Pause/Resume: Press 'p' to pause the game
  • ๐Ÿ† High Scores: Top 10 scores saved automatically
  • ๐ŸŽฏ Smart Spawning: Food never spawns inside snake body

Compile and Run

g++ -o game.exe main.cpp
game.exe

Controls ๐ŸŽฎ

  • w - Move Up
  • s - Move Down
  • a - Move Left
  • d - Move Right
  • p - Pause/Resume
  • q - Quit Game

Run Tests

g++ -o tests.exe snake_test.cpp -lgtest -lgtest_main
tests.exe

Files ๐Ÿ“

  • main.cpp - Game entry point
  • snake.h - Core game logic
  • snake_test.cpp - Unit tests
  • scores.txt - High scores (auto-created)
  • game.exe - Compiled executable

About

snake game on terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%