在 Linux 终端上玩俄罗斯方块
俄罗斯方块

> 
> 用每个人最喜欢的砖块配对游戏“俄罗斯方块”重新创造 20 世纪 80 年代的魔力。
> 
> 
> 


![](/data/attachment/album/201812/25/234327icbhd4gzhq98lauc.png)


感谢你来浏览我们今天的 Linux 命令行玩具日历。如果这是你第一次访问该系列，你可能会问自己，什么是命令行玩具。即使我不太确定，但一般来说，它可能是一个游戏或任何消遣，可以帮助你在终端获得乐趣。


很可能你们中的一些人之前会看到过我们日历中的各种推荐，但我们希望每个人至少遇到一件新事物。


我承诺在我开始这个系列时，我会介绍游戏，但到目前为止，我忽略了它，所以我们今天的选择就是游戏：俄罗斯方块。


俄罗斯方块和我差不多年纪，都在 1984 年夏天来到世界。不过，俄罗斯方块不是来自北卡罗来纳州的农村地区，而是来自当时苏联的莫斯科。


在风靡世界之后，俄罗斯方块被克隆过很多次。我怀疑你可以找到任何你想找的任何语言、操作系统的俄罗斯方块的克隆。说真的，去看看吧。会有一些有趣的。


我今天带来的命令行[版本](https://github.com/samtay/tetris)是[用 Haskell 编写](https://github.com/samtay/tetris)的，它是我见过的做得更好的版本之一，有屏幕预览、得分、帮助、干净的外观。


如果你愿意从不受信任的来源运行已编译的二进制文件（我不推荐它），你可以直接获取它，但有个更安全的方法，使用 [dex](https://github.com/dockerland/dex) 的容器化版本也很容易，或者使用 [stack](https://docs.haskellstack.org/en/stable/README/#how-to-install) 从源代码安装。


这个俄罗斯方块克隆版是由 Sam Tay 编写的，并且在 BSD 许可证下发布。[请看这里获取](https://github.com/samtay/tetris)！


![](/data/attachment/album/201812/25/234339gwpc11j849wuciln.gif)


如果你有自己喜欢的俄罗斯方块克隆版（或者你自己写的？），请告诉我们！


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


查看昨天的玩具，[在 Linux 命令行中计划你自己的假期日历](https://opensource.com/article/18/12/linux-toy-cal)，明天再回来查看！




---


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


作者：[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
Thanks for joining us for today's installment of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself, what’s a command-line toy. Even I'm not quite sure, but generally, it could be a game or any simple diversion that helps you have fun at the terminal.

It's quite possible that some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.

I promised when I started this series I'd be including games, but so far I've neglected to, so let's fix that with today's selection: Tetris.

Tetris and I are almost exactly the same age, having first come into the world in the summer of 1984. Instead of rural North Carolina, though, Tetris originated in Moscow in what was at the time the Soviet Union.

After taking the world by storm, Tetris was cloned many, many times. I would suspect you could find a Tetris clone for just about any operating system in any language you looked for. Seriously, go look. There are some fun ones out there.

The [version](https://github.com/samtay/tetris) I'm bringing you for today's command-line toy is [written in Haskell, ](https://github.com/samtay/tetris)and it's one of the better-done versions I've seen, with on-screen preview, score, help, and a clean look.

If you're willing to run a compiled binary from an untrusted source (I wouldn't recommend it), you can grab that directly, but for a safer approach, it's also easy to use a containerized version with [dex](https://github.com/dockerland/dex), or to install from source with [stack](https://docs.haskellstack.org/en/stable/README/#how-to-install).

This particular Tetris clone is by Sam Tay and available under a BSD license. [Check it out](https://github.com/samtay/tetris)!

![Tetris animation Tetris animation](https://opensource.com/sites/default/files/uploads/linux-toy-tetris-animated.gif)

If you've got your own favorite Tetris clone (or maybe you've written your own?), let us know!

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, [Plan your own holiday calendar at the Linux command line](https://opensource.com/article/18/12/linux-toy-cal), and check back tomorrow for another!

## 3 Comments