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 –
But over time, the Snake Game is replaced by more advanced graphical games with varieties of options. But nothing beats that classic snake game.
And what if I told you, you can play this game in the Linux Terminal itself? It doesn’t matter whether you are running Ubuntu Linux, Fedora Linux or Arch Linux. This game is available for most of the distros.
Install nSnake – Snake Game for Linux Terminal
You can install this game via 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 using the following steps.
- Set up Yay AUR helper
- Then open a terminal and run the below command
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
Plying the game is very simple. Type
nsnake in 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 is available via main menu.
To compile the latest version, use the following commands in all Linux distributions.
Oh, make sure you have
ncurses-devel installed, which are the required packages for compilation.
git clone https://github.com/alexdantas/nSnake.git
So, do you like Snake Game? Do you prefer it over other terminal based games? Share your views with other readers i the comment box below.