如何在 Linux 中安装 2048 游戏
游戏 2048

> 
> 流行的移动益智游戏 2048 也可以在 Ubuntu 和 Linux 发行版上玩。啊！你甚至可以在 Linux 终端上玩 2048。如果你的生产率因为这个让人上瘾的游戏下降，请不要怪我。
> 
> 
> 


早在 2014 年，2048 就是 iOS 和 Android 上最受欢迎的游戏之一。这款令人上瘾的游戏非常受欢迎，它在 Linux 上有[浏览器版](http://gabrielecirulli.github.io/2048/)、桌面版和终端版。


通过向上和向下，向左和向右移动滑块来玩这个小游戏。这个益智游戏的目的是通过组合匹配的滑块到数字 2048。因此 2+2 变成 4，4+4 变成 8，依此类推。这可能听起来简单而无聊，但相信我是一个令人上瘾的游戏。


### 在 Linux 中玩 2048 [GUI]


在 Ubuntu 和其他 Linux 中有些 2048 游戏。你可以在软件中心中搜索它，你可以在那里找到一些。


有一个[基于 Qt](https://www.qt.io/) 的 2048 游戏，你可以在 Ubuntu 和其他基于 Debian 和 Ubuntu 的 Linux 发行版上安装。你可以使用以下命令安装它：



```
sudo apt install 2048-qt
```

安装完成后，你可以在菜单中找到该游戏并启动它。你可以使用箭头键移动数字。你的最高分也会保存。


![2048 Game in Ubuntu Linux](/data/attachment/album/201809/08/080621uoot78o1ehaa1dwt.jpg)


### 在 Linux 终端玩 2048


2048 的流行将它带到了终端。如果这让你感到惊讶，你应该知道 Linux 中有很多[很棒的终端游戏](https://itsfoss.com/best-command-line-games-linux/)，而 2048 肯定就是其中之一。


现在，有几种方法可以在 Linux 终端中玩 2048。我在这里提其中两个。


#### 1、term2048 Snap 程序


有一个名为 [term2048](https://snapcraft.io/term2048) 的 [snap 程序](https://itsfoss.com/use-snap-packages-ubuntu-16-04/)可以安装在任何[支持 Snap 的 Linux 发行版](https://itsfoss.com/install-snap-linux/)中。


如果你启用了 Snap，只需使用此命令安装 term2048：



```
sudo snap install term2048
```

Ubuntu 用户也可以在软件中心找到这个游戏并从那里安装它。


![2048 Terminal Game in Linux](/data/attachment/album/201809/08/080621szmhnnm97797u9nh.png)


安装后，你可以使用命令 term2048 来运行游戏。它看起来像这样：


![2048 Terminal game](/data/attachment/album/201809/08/080622kwuj1up5n3fjiohj.jpg)


你可以使用箭头键移动。


#### 2、2048 游戏的 Bash 脚本


这个游戏实际上是一个 shell 脚本，你可以在任何 Linux 终端上运行。从 Github 下载游戏/脚本：


* [下载 Bash2048](https://github.com/mydzor/bash2048)


解压下载的文件。进入解压后的目录，你将看到名为 2048.sh 的 shell 脚本。只需运行 shell 脚本。游戏将立即开始。你可以使用箭头键移动滑块。


![Linux Terminal game 2048](/data/attachment/album/201809/08/080622b08up0d8lpxncp08.png)


### 你在Linux上玩什么游戏？


如果你喜欢在 Linux 终端上玩游戏，你也应该尝试 [Linux 终端中的经典 Snake 游戏](https://itsfoss.com/nsnake-play-classic-snake-game-linux-terminal/ "nSnake: Play The Classic Snake Game In Linux Terminal")。


你经常在 Linux 中玩哪些游戏？你也在终端中玩游戏吗？如果是的话，哪个是你最喜欢的终端游戏？




---


via: <https://itsfoss.com/2048-game/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

Back in 2014, 2048 was one of the most popular games on iOS and Android. This highly addictive game got so popular that it got a [browser version](http://gabrielecirulli.github.io/2048/), desktop version as well as a terminal version on Linux.

This tiny game is played by moving the tiles up and down, left and right. The aim of this puzzle game is to reach 2048 by combining tiles with matching number. So 2+2 becomes 4, 4+4 becomes 16 and so on. It may sound simple and boring but trust me its hell of an addictive game.

## Play 2048 in Linux [GUI]

There are several implementations of 2048 game available in Ubuntu and other Linux. You can simply search for it in the Software Center and you’ll find a few of them there.

There is a [Qt-based](https://www.qt.io/) 2048 game that you can install on Ubuntu and other Debian and Ubuntu-based Linux distributions. You can install it using the command below:

`sudo apt install 2048-qt`


Once installed, you can find the game in the menu and start it. You can move the numbers using the arrow keys. Your highest score is saved as well.

![2048 Game in Ubuntu Linux](https://itsfoss.com/content/images/wordpress/2018/07/2048-qt-ubuntu.jpeg)

## Play 2048 in Linux terminal

The popularity of 2048 brought it to the terminal. If this surprises you, you should know that there are plenty of [awesome terminal games in Linux](https://itsfoss.com/best-command-line-games-linux/) and 2048 is certainly one of them.

Now, there are a few ways you can play 2048 in Linux terminal. I’ll mention two of them here.

### 1. term2058 Snap application

There is a [snap application](https://itsfoss.com/use-snap-packages-ubuntu-16-04/) called [term2048](https://snapcraft.io/term2048) that you can install in any [Snap supported Linux distribution](https://itsfoss.com/install-snap-linux/).

If you have Snap enabled, just use this command to install term2048:

`sudo snap install term2048`


Ubuntu users can also find this game in the Software Center and install it from there.

![2048 Terminal Game in Linux](https://itsfoss.com/content/images/wordpress/2018/07/term2048-game.png)

Once installed, you can use the command term2048 to run the game. It looks something like this:

![2048 Terminal game](https://itsfoss.com/content/images/wordpress/2018/07/term2048.jpg)

You can move using the arrow keys.

### 2. Bash script for 2048 terminal game

This game is actually a shell script which you can run in any Linux terminal. Download the game/script from Github:

Extract the downloaded file. Go in the extracted directory and you’ll see a shell script named 2048.sh. Just run the shell script. The game will start immediately. You can move the tiles using the arrow keys.

![Linux Terminal game 2048](https://itsfoss.com/content/images/wordpress/2018/07/2048-bash-terminal.png)

## What games do you play on Linux?

If you like playing games in the Linux terminal, you should also try the [classic Snake game in Linux terminal](https://itsfoss.com/nsnake-play-classic-snake-game-linux-terminal/).

[Top 10 Command Line Games For LinuxYou can play games on the Linux terminal. Here are the best command line games for you.](https://itsfoss.com/best-command-line-games-linux/)![](https://itsfoss.com/content/images/2023/01/best-command-line-games-for-linux.png)


![](https://itsfoss.com/content/images/2023/01/best-command-line-games-for-linux.png)

Which games do you regularly play in Linux? Do you also play games in the terminal? If yes, which is your favorite terminal game?