Skip to content

gamekeepers/snake-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snake Game

A classic snake game implemented in C++.

Features

  • Classic snake gameplay
  • Keyboard controls
  • Threaded input and game logic
  • Unit tests using Google Test framework

Getting Started

Prerequisites

  • A C++ compiler (like g++)
  • CMake (version 3.10 or higher)
  • Google Test library

Building the Project

  1. Create a build directory:
    mkdir build
  2. Navigate to the build directory:
    cd build
  3. Run CMake to configure the project:
    cmake ..
  4. Compile the project:
    make

This will create two executables in the build directory: snake_game and snake_tests.

Running the Game

To play the game, run the following command from the build directory:

./snake_game

Running Tests

To run the tests, execute the following command from the build directory:

./snake_tests

How to Play

Use the WASD keys to control the snake's direction. The goal is to eat the food that appears on the screen, which makes the snake grow longer. The game ends if the snake runs into the wall or into itself.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

snake game on terminal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published