BlockTran
November 28, 2025 ยท View on GitHub
Text/console Tetris-inspired falling-block tetromino game written in object-oriented Fortran 2008.

- user-configurable playfield size
- Logs pieces played to
blocktran.logso you can recreate memorable games. - uniform random game piece generation.
- clean, object-oriented Fortran 2008 syntax
- Curses (Ncurses, PDcurses) used for display, called directly from Fortran code.
Build
BlockTran works on Mac, Linux, native Windows, Cygwin, Windows Subsystem for Linux. Requires a Fortran compiler and CMake. Works at least with Gfortran, Flang, Intel oneAPI, NVHPC, ....
cmake -B build
cmake --build build
If trouble building with MinGW / MSYS2 on Windows with Ncurses, try auto-building PDCurses:
cmake -Bbuild -Dfind=no --fresh
cmake --build build
or using Fortran FPM:
fpm build
fpm run
The main executable file is build/blocktran. You can copy this file to your Desktop or wherever you like.
Linux / macOS
Ncurses is required. Alternatively, PDCurses + X11 development libraries are required for building on Linux.
Install X11 on Linux:
dnf install libX11-devel libXt-devel libXaw-devel ncurses-devel
# or
apt install libmxu-dev libxpm-dev libxt-dev libxaw7-dev libx11-dev
on macOS:
brew install libxt libxaw libx11
Play
difficulty level
adjust cadence of falling blocks with -d option, including decimal point:
blocktran -d 1.2
Higher number increase difficulty. Must include decimal point.
Playfield size
specify width and height of the playfield with -s option:
blocktran -s 20 15
play against computer
The computer player is rudimentary.
blocktran -p 2
debug mode
Debug logging is enabled by:
blocktran --debug
Controls
Other "secret" cheat keys exist! You can also use arrow keys.
| Key | Effect |
|---|---|
| W | Rotate piece |
| A/D | Left and right respectively |
| S | Move down faster |
| Q or Esc | Exit the game |
Notes
Block distribution is uniformly random as confirmed by:
./blockrand
References
- Control codes
- legacy / demo author: Lewis Bobbermen