How to Install and play Games from Terminal - Part 2

To Install and play Games from Terminal

In this article we will discuss how to install some of the games from linux terminal and how to play the games in the terminal.


To play nudoku game

nudoku is similar to Sudoku game.

root@linuxhelp1:~# wget https://github.com/jubalh/nudoku/releases/download/0.2.4/nudoku-0.2.4.tar.xz
--2016-07-14 23:06:23--  https://github.com/jubalh/nudoku/releases/download/0.2.4/nudoku-0.2.4.tar.xz
Resolving github.com (github.com)... 192.30.253.113
Connecting to github.com
(github.com)|192.30.253.113|:443... connected.
.
.
.
nudoku-0.2.4.tar.xz 100%[===================> ]  65.97K  33.1KB/s    in 2.0s    
2016-07-14 23:06:27 (33.1 KB/s) - ‘ nudoku-0.2.4.tar.xz’  saved [67556/67556]

To extract the tar file.

root@linuxhelp1:~# ls
Desktop    Downloads         Music                Pictures  Templates
Documents  examples.desktop  nudoku-0.2.4.tar.xz  Public    Videos
root@linuxhelp1:~# tar -xjf nudoku-0.2.4.tar.xz
root@linuxhelp1:~# ls
Desktop    examples.desktop  nudoku-0.2.4.tar.xz  Templates
Documents  Music             Pictures             Videos
Downloads  nudoku-0.2.4      Public
root@linuxhelp1:~# cd nudoku-0.2.4/

Before installing the game, install the dependencies.

root@linuxhelp1:~/nudoku-0.2.4# apt-get install libncurses5-dev groff
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libtinfo-dev psutils
Suggested packages:
  ncurses-doc
The following NEW packages will be installed:
  groff libncurses5-dev libtinfo-dev psutils
.
.
.
Setting up libncurses5-dev:amd64 (6.0+20160213-1ubuntu1) ...

Install the game by using the following commands.

root@linuxhelp1:~/nudoku-0.2.4# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
.
.
.
config.status: creating src/Makefile
config.status: executing depfiles commands
root@linuxhelp1:~/nudoku-0.2.4# make
Making all in src
make[1]: Entering directory ' /home/user1/nudoku-0.2.4/src' 
gcc -DPACKAGE_NAME=" nudoku"  -DPACKAGE_TARNAME=" nudoku"  -DPACKAGE_VERSION=" 0.2.4"  -DPACKAGE_STRING=" nudoku 0.2.4"  -DPACKAGE_BUGREPORT=" jubalh@openmailbox.org"  -DPACKAGE_URL=" "  -DPACKAGE=" nudoku"  -DVERSION=" 0.2.4"  -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 &ndash D
.
.
.
mv -f .deps/sudoku.Tpo .deps/sudoku.Po
gcc  -g -O2   -o nudoku main.o sudoku.o -lncurses
make[1]: Leaving directory ' /home/user1/nudoku-0.2.4/src' 
make[1]: Entering directory ' /home/user1/nudoku-0.2.4' 
make[1]: Nothing to be done for ' all-am' .
make[1]: Leaving directory ' /home/user1/nudoku-0.2.4' 

To Run the game execute the below command.

root@linuxhelp1:~/nudoku-0.2.4# ./src/nudoku


To install 2048

Run the following command to install 2048 game.

root@linuxhelp1:~# wget https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c
--2016-07-14 23:39:19--  https://raw.githubusercontent.com/mevdschee/2048.c/master/2048.c
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.100.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.100.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9255 (9.0K) [text/plain]
Saving to: ‘ 2048.c’ 

2048.c              100%[===================> ]   9.04K  --.-KB/s    in 0s      

2016-07-14 23:39:20 (40.1 MB/s) - ‘ 2048.c’  saved [9255/9255]

To install the game run the following command.

root@linuxhelp1:~# gcc -o 2048 2048.c

Utilise the following command to play the game in the terminal.

root@linuxhelp1:~# ./2048

To play ninvaders game

Ninvaders is a clone of space invaders game. Now install the package for that game.

root@linuxhelp1:~# apt-get install ninvaders -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  ninvaders
0 upgraded, 1 newly installed, 0 to remove and 154 not upgraded.
Need to get 0 B/15.7 kB of archives.
After this operation, 49.2 kB of additional disk space will be used.
Selecting previously unselected package ninvaders.
(Reading database ... 207162 files and directories currently installed.)
Preparing to unpack .../ninvaders_0.1.1-3build1_amd64.deb ...
Unpacking ninvaders (0.1.1-3build1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up ninvaders (0.1.1-3build1) ...

To run the game.

root@linuxhelp1:~# cd /usr/games/
root@linuxhelp1:/usr/games# ./ninvaders

To play nethack game

Use the following command to install nethack.

root@linuxhelp1:~# apt-get install nethack-console -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  nethack-common
The following NEW packages will be installed:
  nethack-common nethack-console
0 upgraded, 2 newly installed, 0 to remove and 154 not upgraded.
Need to get 1,230 kB of archives.
After this operation, 3,343 kB of additional disk space will be used.
.
.
.
Setting up nethack-console (3.4.3-15build1) ...
update-alternatives: using /usr/lib/games/nethack/nethack-console.sh to provide /usr/games/nethack (nethack) in auto mode
Processing triggers for systemd (229-4ubuntu6) ...
Processing triggers for ureadahead (0.100.0-19) ...

To play the game.

root@linuxhelp1:~# cd /usr/games/
root@linuxhelp1:/usr/games# ./nethack

FAQ
Q
Why doesn't the Back key work?
A
It sends the "ESC" character by default. Use the Preferences panel to change this behavior:

Menu Key -> "More"-> "Preferences" -> Back button behavior
Q
Where can I get Busybox for my Android Phone?
A
Do a web search for "Android Busybox" and read through the results.
Q
What sort of games does this emulator play?
A
Sorry, this is a terminal emulator, not a game emulator. It has nothing to do with games.
Q
Alternative for sudoko ?
A
Griddition, hodoko and much more.
Q
While running make ? It throws certain error
A
whereas "./src/nudoku" is used for launching