2 的威力，Linux 的威力：终端中的 2048
2048

> 
> 正在寻找基于终端的游戏来打发时间么？来看看 2048-cli 吧。
> 
> 
> 


![](/data/attachment/album/201901/16/085325rtbawhbxb55z1skk.png)


你好，欢迎来到今天的 Linux 命令行玩具日历。每天，我们会为你的终端带来一个不同的玩具：它可能是一个游戏或任何简单的消遣，可以帮助你获得乐趣。


很可能你们中的一些人之前已经看过我们日历中的各种玩具，但我们希望每个人至少见到一件新事物。


今天的玩具是我最喜欢的休闲游戏之一 [2048](https://github.com/gabrielecirulli/2048) （它本身就是另外一个克隆品的克隆）的[命令行版本](https://github.com/tiehuis/2048-cli)。


要进行游戏，你只需将滑块向上、向下、向左、向右移动，组合成对的数字，并增加数值，直到你得到数字为 2048 的块。最吸引人的地方（以及挑战）是你不能只移动一个滑块，而是需要移动屏幕上的每一块。（LCTT 译注：不知道有没有人在我们 Linux 中国的网站上遇到过 [404](https://linux.cn/404) 页面？那就是一个 2048 游戏，经常我错误地打开一个不存在的页面时，本应该去修复这个问题，却不小心沉迷于其中……）


它简单、有趣，很容易在里面沉迷几个小时。这个 2048 的克隆 [2048-cli](https://github.com/tiehuis/2048-cli) 是 Marc Tiehuis 用 C 编写的，并在 MIT 许可下开源。你可以在 [GitHub](https://github.com/tiehuis/2048-cli) 上找到源代码，你也可在这找到适用于你的平台的安装说明。由于它已为 Fedora 打包，因此我来说，安装就像下面那样简单：



```
$ sudo dnf install 2048-cli
```

这是这样，玩得开心！


![](/data/attachment/album/201901/16/085326q344s654stst563c.gif)


你有特别喜欢的命令行小玩具需要我介绍的吗？这个系列要介绍的小玩具大部分已经有了落实，但还预留了几个空位置。如果你有特别想了解的可以评论留言，我会查看的。如果还有空位置，我会考虑介绍它的。如果没有，但如果我得到了一些很好的意见，我会在最后做一些有价值的提及。


查看昨天的玩具，[在 Linux 终端中玩俄罗斯方块](https://opensource.com/article/18/12/linux-toy-tetris)，记得明天再来！




---


via: <https://opensource.com/article/18/12/linux-toy-2048>


作者：[Jason Baker](https://opensource.com/users/jason-baker) 选题：[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
Hello and welcome to today's installment of the Linux command-line toys advent calendar. Every day, we look at a different toy for your terminal: it could be a game or any simple diversion that helps you have fun.

Maybe you have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.

Today's toy is a [command-line version](https://github.com/tiehuis/2048-cli) of one of my all-time favorite casual games, [2048](https://github.com/gabrielecirulli/2048) (which itself is a clone of another clone).

To play, you just slide blocks up, down, left, and right to combine matching pairs and increment numbers, until you've made a block that is 2048 in size. The catch (and the challenge), is that you can't just move one block; instead, you move every block on the screen.

It's simple, fun, and easy to get lost in it for hours. This 2048 clone, [2048-](https://github.com/tiehuis/2048-cli)[cli](https://github.com/tiehuis/2048-cli), is by Marc Tiehuis and written in C, and made available as open source under an MIT license. You can find the source code [on GitHub](https://github.com/tiehuis/2048-cli), where you can also get installation instructions for your platform. Since it was packaged for Fedora, for me, installing it was as simple as:

`$ sudo dnf install 2048-cli`


That's it, have fun!

![Animated 2048 Animated 2048](https://opensource.com/sites/default/files/uploads/linux-toy-2048-animated_0.gif)

Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.

Check out yesterday's toy, [Play Tetris at your Linux terminal](https://opensource.com/article/18/12/linux-toy-tetris), and check back tomorrow for another!

## Comments are closed.