TranslateProject/sources/tech/20221013 Enjoy the Classic Snake Game in Your Linux Terminal.md
2022-10-20 08:53:22 +08:00

3.6 KiB
Raw Blame History

Enjoy the Classic Snake Game in Your Linux Terminal

This is how you can install and play the classic Snake Game in Linux Terminal.

Remember the classic and simple snake game of old mobile phones? I remember playing it for hours. Hey, no other options at the time, right? Smartphones were still not in the market. And all you have is this

Nokia 3310 with legacy snake game

But over time, the Snake Game was replaced by more advanced graphical games with various options. But nothing beats that classic snake game.

And what if I told you, you could play this game in the Linux Terminal itself? Whether you are running Ubuntu Linux, Fedora Linux or Arch Linux doesnt matter. This game is available for most of the distros.

nsnake Game - Main Menu

Install nSnake Snake Game for Linux Terminal

You can install this game via the terminal using the below methods.

For Ubuntu, Linux Mint or other related distributions:

sudo apt install nsnake

For Fedora Linux and others:

sudo dnf install nsnake

For Arch Linux, this snake game is available in the Arch User repository. You can install it using the following steps.

yay -S nsnake

The above command installs the stock repository version of the game, which might not be the latest. However, if you want the latest version, you may need to compile the source via GitHub. I have added the compilation instructions at the end of this page for your reference.

Playing the game

Playing the game is very simple. Type nsnake in the terminal, which will launch the game.

To quit immediately, press q.

Following are the default key bindings.

  • Arrow keys to move the snake
  • q Quit the game
  • p Pause the game

You can also configure the game in various ways, which are available via the main menu.

nsnake Linux Terminal Snake Game Settings

So, enjoy!

Compilation

To compile the latest version, use the following commands in all Linux distributions.

Oh, make sure you have git and ncurses-devel installed, which are the required packages for compilation.

git clone https://github.com/alexdantas/nSnake.gitcd nsnakemakemake install

So, do you like Snake Game? Do you prefer it over other terminal-based games? Share your views with other readers in the comment box below.


via: https://www.debugpoint.com/snake-game-linux-terminal/

作者:Arindam 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出