Linux Candy

Linux Candy: tetris – terminal interface for Tetris

Last Updated on May 25, 2022

Who loves eye candy? Don’t be shy — you can raise both hands!!

Linux Candy is a series of articles covering interesting eye candy software. We’re only featuring open-source software in this series.

If you spend all day embroiled in political in-fighting, fighting bureaucracy, coding a new program in Assembler, sit in countless meetings wishing you were relaxing on a Caribbean island, you’ll need some light relief at the end of the day. And what better way by making your desktop environment a bit more fun.

There’s lots of fun in the terminal. How about a classic iconic tile-matching puzzle video game? Step forward tetris, a terminal interface for Tetris with the main file coded in a mere 333 lines of Haskell.

Installation

As I’m running Arch, I installed tetris with the Arch User Repository. It pulled in a ton of other software though. Alternatively, it’s trivial to install from the project’s GitHub repository, with:

$ git clone https://github.com/samtay/tetris.git
$ cd tetris
$ stack install tetris

You’ll need Stack installed to compile the source code. Stack is a cross-platform program for developing Haskell projects.

In Operation

Here’s an image of tetris in action.
Tetris

When you start the game, you have the choice of skipping one or more of the levels. The graphics are colorful. There’s stats, level indicator, and a high score facility to boot. And it even sports Vi(m) navigation keys. What more could you want in such a tiny program?

There’s a few options available. You can turn off the preview cell which helps to increase the difficulty. You can also start at a specific level.

In the game, you can drop a block, pause the game, and restart the game if it’s going badly.

Summary

tetris is a faithful classic of the timeless classic video game. It’s a bit of light-hearted relief, offers some harmless fun, and brightens up my terminal at the same time.

tetris uses Unicode graphics, but if this cause a problem in your terminal, you can play the game using ASCII graphics only.

There’s no leaderboard, just a single highest score. Report that score with:

$ tetris --high-score

Website: www.doof.me.uk/xcowsay
Support:
Developer: Sam Tay
License: Open Source

tetris is written in Haskell. If you’re looking to improve your knowledge of this language, check out our recommended free Haskell books and free Haskell tutorials.

Complete list of articles in this series:

Linux Candy
ASCIIQuariumEmbrace marine life from the terminal with beautiful ASCII art
ASCII Art ConverterA small utility that converts images into ASCII art
BobRossQuotesCollection of quotes from Bob Ross
BoxesCommand line ASCII boxes
BuohOnline strips comics reader
cacafireColor ASCII fire
catclockxclock with an enhanced cat mode
cbonsaiGenerate bonsai trees in the terminal
christmasfetchFestive cheer on the desktop
chucknorrisChuck Norris jokes in your terminal
cornyjokesCorny jokes for the terminal
CMatrixncurses program that simulates the display from “The Matrix”
ctreeA Christmas tree right on your terminal
eDEX-UISci-fi computer terminal emulator and system monitor
emojSimple tool that to find suitable emojis for pasting to your clipboard
EmoteModern popup emoji picker
EvolvotronInteractive generative art
FantasceneDynamic wallpaper changer
FondoFind beautiful wallpapers from Unsplash
gtiTypo-based curio inspired by Steam Locomotive
HollywoodFill your console with Hollywood melodrama technobabble
linuxwaveGenerate music from the entropy of Linux
lolcatRainbows and unicorns
No More SecretsRecreates the data decryption effect from the Sneakers movie
nookPlays Animal Crossing hourly themes on the hour
nyancatTerminal-based Pop Tart Cat Animation
onekoAnimal chasing fun
pipes.shAnimated pipes terminal screensaver
ponysaycowsay reimplemention for ponies
projectMMusic visualizer originally based on Milkdrop
pscircleA different take on the venerable ps command
PyBonsaiGenerates procedural ASCII art trees
pyjokesOne line jokes for programmers
PywalGenerate color schemes on the fly
RelaxatorRelax to soothing sounds
Rusty AquariumMonitoring by visualization
Steam LocomotiveC program written in 295 lines. It's harmless fun
TernimalAnimated lifeform in the terminal
terminal-parrotParty parrot time
tetrisTile-matching puzzle video game in your terminal
VarietyWallpaper manager with many desktops and wallpaper sources
WallGenGenerate HQ poly wallpapers with a few arguments.
WallpaperDownloaderDownload, change, and manage wallpapers
xcowsayDisplays a cow on your desktop with message
XDecorationsAdd some festive cheer to your desktop
XScreenSaverFramework and collection of screensavers
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Please read our FAQ before making a comment.

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments