Skip to content

snake, a free and open-source modern implementation of the beloved classic game. The project utilizes the ncurses library in C to provide a sleek terminal environment for an immersive and enjoyable gaming experience. Effortlessly control the snake with arrow keys or vim-like keys (h, j, k, l).

License

Notifications You must be signed in to change notification settings

printfer/snake-game

Repository files navigation

Snake

snake, a free and open-source modern implementation of the beloved classic game. The project utilizes the ncurses library in C to provide a sleek terminal environment for an immersive and enjoyable gaming experience. Effortlessly control the snake with arrow keys or vim-like keys (h, j, k, l).

Snake Game

Features

  • Intuitive controls using arrow keys or vim-like keys (h, j, k, l)
  • Random food generation for a more captivating and unpredictable gaming experience
  • Random initial direction for the snake, adding variety to each game session
  • Score tracking to challenge yourself and improve your skills
  • Smooth and intuitive terminal UI for seamless control

Getting Started

Prerequisites

  • GCC (GNU Compiler Collection)
  • ncurses library

Installing

To install the ncurses library on Ubuntu or Debian-based systems, run:

sudo apt-get install libncurses-dev

On Fedora, CentOS or RHEL-based systems, run:

sudo dnf install ncurses-devel

On Arch Linux or Arch-based systems, run:

sudo pacman -S ncurses

Compiling and Running

To run the program directly, navigate to the project directory and execute the following command, which will handle the build process for you:

make run

Alternatively, you can manually compile the program first by running:

make

After compiling, the build directory will be located under build, and the binary under bin. You can then run the program using the following command:

./bin/snake

Contributing

We welcome contributions from the community! If you'd like to contribute to the project, please follow these steps to set up the development environment:

  • Install the necessary dependencies mentioned in the "Installing" section.
  • Clone the repository and navigate to the project directory.
  • Run the ./setup.sh script to set up the development environment.

Once you have set up the development environment, you can start making changes to the codebase. After making your changes, be sure to test your updates by compiling and running the project as described in the "Compiling and Running" section.

When you're ready to submit your changes, create a pull request, and we will review your contribution.

Changelog

For the complete changelog, see the CHANGELOG.md file.

License

This project is licensed under the GPLv3 License. See the LICENSE file for more information.

Credits

snake has been designed and created by Printfer with ❤️

Copyright © 2023 Printfer

About

snake, a free and open-source modern implementation of the beloved classic game. The project utilizes the ncurses library in C to provide a sleek terminal environment for an immersive and enjoyable gaming experience. Effortlessly control the snake with arrow keys or vim-like keys (h, j, k, l).

Topics

Resources

License

Stars

Watchers

Forks