Skip to content

Dolfost/snake-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snake-cpp

Hello and welcome to the home of the ncurses snake game written in neovim by one enthusiast in his spare time!

Game features

  • Speed
  • Performance
  • Beauty
  • Portability
  • Tries to be POSIX-compliant
  • "Window" system
  • Game itself
  • Scoreboard
  • Help window
  • Log windows
  • Terminal options

Screenshots

Pause Game over
Standby Scoreboard
Help Log

Sidelog

How to install

Installing dependencies

Game relies on the

  • newcurses C library, likely You will have to install it on Your machine.
  • cmake program.
Mac OS

If You use MacOS You can install newcurses with homebrew simply by

brew install ncurses
Unix-like OS

Short answer: It depends.
For example, if You are using Ubuntu You can install newcurses and g by

sudo apt-get install libncurses5-dev libncursesw5-dev clang

If You say I use Arch btw often, You can try

sudo pacman -S ncurses g  

If Your distro isn't mentioned here, try to use google:

how to install ncurses in *put Your distro name here*

how to install g   in *put Your distro name here*

how to get cmake running on *put Your distro name here*

Getting the sources

Enter desired directory and run

git clone https://github.com/Dolfost/snake-cpp
cd snake-cpp

It will create the directory with name snake-cpp and enter it. Then You have to compile the game.

Compiling the game

To build the game You can:

cmake -B build; cmake --build build
./build/snake --build-help-pad

It will create the game executable snake in the build/ direcotry and build the help pad for current terminal.

Running the game

  • Open the terminal window not smaller than 42 lines by 80 columns

  • To start the game You can execute

    ./build/shanke
    

    in the git directory root.

    If You are new to the game (probably You are), I recommend You to start game with the --help or -h option, so You can get used to it.

    ./build/snake --help
    

Contributing

If You find any bugs or unexpected behaviors or just want to contribute to the snake-cpp, You are welcome at the issues tab.