Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

cxxmatrix

> 编程语言
Open source

C++ Matrix: The Matrix Reloaded in Terminals (Number falls, Banners, Matrix rains, Conway's Game of Life and Mandelbrot set)

735 stars0 likes0 views
WebsiteGitHub

About

C++ Matrix: The Matrix Reloaded in Terminals (Number falls, Banners, Matrix rains, Conway's Game of Life and Mandelbrot set)

C++ Matrix in terminal

I wrote a simple terminal program of Matrix digital rain. A part of the purpose of this program is to test the performance of terminal emulators. Another purpose is just for fun. Enjoy it with fast terminals (e.g., urxvt, alacritty, terminology, etc.)!

Features

  • Hankaku kana characters as in the original film
  • Ten levels of "green"s using terminal 256 color support
  • Twinkling effects by adding random brightness fluctuations
  • Diffused reflection effects by cell background colors

Scenes

By default, the following scenes will be visited in turn. If you want to see each scene, please see the help (cxxmatrix --help).

  1. Number falls
  2. Banner - Show command line arguments by shining characters
  3. "The Matrix" rain - Wikipedia
  4. Conway's Game of Life - Wikipedia
  5. The Mandelbrot set - Wikipedia
  6. (End scene) "The Matrix" rain

Demo

  • cxxmatrix in 80x28 - Youtube
  • The Mandelbrot set in 479x186 - YouTube
  • Highlight scenes - See the animated GIF below

Usage

This program is provided under the MIT License.

Prerequisites

  • git, C++17 compiler, GNU make, GNU awk
  • UTF-8 support of the system
  • a fast terminal with 256color and UTF-8 support

Compile and Run

$ git clone https://github.com/akinomyoga/cxxmatrix.git
$ cd cxxmatrix
$ make
$ ./cxxmatrix 'The Matrix' 'Reloaded'

Quit: C-c; Suspend: C-z; Menu: RET, C-m

Compile MSYS2 binary (MSYS2 PTY) using MSYS2

The MSYS package msys2-devel is required in order to use the MSYS2 compiler.

msys2$ pacman -Syu
msys2$ pacman -S git gawk make msys2-devel
msys2$ git clone https://github.com/akinomyoga/cxxmatrix.git
msys2$ cd cxxmatrix
msys2$ PATH=/usr/bin:$PATH make

Compile Windows binary (ConPTY) using MinGW/MSYS2

The Windows binary based on Windows Pseudo Console API (ConPTY) can be compiled on MinGW/MSYS2 by passing TARGET=win32 to make. It should be noted that ConPTY is extremely slow.

msys2$ pacman -Syu
msys2$ pacman -S git gawk make mingw-w64-x86_64-gcc
msys2$ git clone https://github.com/akinomyoga/cxxmatrix.git
msys2$ cd cxxmatrix
msys2$ PATH=/mingw64/bin:$PATH make TARGET=win32

Options

Check the help with cxxmatrix --help:

…

Select scenes

# Example: Show the Mandelbrot set
./cxxmatrix -s mandelbrot

# Example: Loop Number falls and Conway's Game of Life
./cxxmatrix -s number,conway,loop

Install

sudo make install

The default install prefix is /usr/local. The following files will be created:

  • /usr/local/bin/cxxmatrix
  • /usr/local/share/man/man1/cxxmatrix.1.gz
  • /usr/local/share/licenses/cxxmatrix/LICENSE.md

The make variable PREFIX can be specified to change the install prefix. To copy files in a temporary location, the make variable DESTDIR can also be specified. To change the subdirectory of LICENSE.md, the make variable INSTALL_SUBDIR_LICENSE (whose detault value is share/licenses/cxxmatrix) can be adjusted.

# Example 1: install cxxmatrix in user directory
make install PREFIX=~/.local

# Example 2: install cxxmatrix in /opt
sudo make install PREFIX=/opt/cxxmatrix

# Example 3: create a package
make install DESTDIR=/tmp/packages/cxxmatrix PREFIX=/usr/local

# Example 4: put LICENSE.md in /usr/local/share/cxxmatrix
sudo make install INSTALL_SUBDIR_LICENSE=share/cxxmatrix

See also

  • AUR Package: AUR (en) - cxxmatrix-git by @ignapk
  • FreeBSD Package: misc/cxxmatrix by @nunotexbsd (Nuno Teixeira )

Similar projects

Related tags in GitHub:

  • #matrix-rain
  • #matrix-digital-rain

In each section, the projects are ordereded by the number of stars, which is shown in parentheses for each project. This list including the numbers of stars is updated when cxxmatrix is updated so does not reflect the current status. The numbers of stars are last updated on 2022-03-24 19:57:14 JST.

The Matrix rains in terminals

  • abishekvashok/cmatrix - Demo in C (3801)
  • will8211/unimatrix - Demo in Python3 (1642)
  • akinomyoga/cxxmatrix - HN in C++ (671)
  • st3w/neo - Demo, Reddit 1 2 3 4 in C++ (620)
  • nojvek/matrix-rain - Demo in Node (434)
  • M4444/TMatrix - Demo, Reddit in C++ (376)
  • cowboy8625/rusty-rain - Demo, Reddit in Rust (338)
  • GeertJohan/gomatrix - Youtube in Go (284)
  • domsson/fakesteak - Demo, Reddit in C (102)
  • levithomason/cmatrix - Demo in C (84)
  • jsbueno/terminal_matrix - Demo in Python (73)
  • torch2424/wasm-matrix - Demo in WASM (69)
  • joechrisellis/pmatrix - Demo in Python (42)
  • amstrad/oh-my-matrix - Demo in Python (24)
  • tech-chad/pymatrix-rain - Demo in Python (24)
  • txstc55/matrix_viewer - Demo in C++ (21)
  • principle105/matrix_rain - Demo in Python (21)
  • b166erbot/matrix in Python3 (19)
  • meganehouser/rustmatrix - Demo in Rust (18)
  • iZucked/Matrix-Rain-An-Image - Demo in Python (17)
  • henriquebastos/the-matrix-rain - Demo in Python (12)
  • JaydenL33/cmatrix2.0 in C (7)
  • aguegu/greenrain - Demo in C++ (6)
  • kevinelong/rain Demo, Youtube, Reddit - in Python (3)
  • stefrush/enterthematrix - Demo in Python (3)
  • Shizcow/smatrix in Rust (3)
  • open-channel-d/digital-rain - Demo in C++ (2)
  • artgl42/MatrixDigitalRain - Demo in C# (2)
  • roee30/rmatrix in Rust (1)
  • gurushida/matrixmirror - Demo in Objective-C (0)

The Matrix rains in browsers

  • Rezmason/matrix - Demo, HN in HTML5 Canvas (3244)
  • tidwall/digitalrain - Demo in HTML5 Canvas (380)
  • emilyxxie/green_rain - Demo in HTML5 Canvas (262)
  • winterbe/github-matrix - Demo in HTML5 Canvas (209)
  • neilcarpenter/Matrix-code-rain - Demo in HTML5 Canvas (107)
    • janemiceli/matrix - Demo (9)
    • janemiceli/matrix4rainbow - Demo (1)
    • janemiceli/Happy_birthday_angie - Demo (1)
  • syropian/HTML5-Matrix-Code-Rain - Demo in HTML5 Canvas (34)
  • raphaklaus/matrix-fx - Demo in CSS3 (28)
  • pazdera/matrix-vr - Demo in WebVR (26)
  • C-o-d-e-C-o-w-b-o-y/matrix-rain-background-react - Demo in React (22)
  • lhartikk/BtcTxMatrix - Demo in HTML5 Canvas (14)
  • Rudxain/RGB-digital-rain - Demo in HTML5 Canvas (14)
  • anderspitman/redpill - Demo in HTML5 Canvas (9)
  • zhaihaoran/digital-rain - Demo in HTML5 Canvas (6)
  • Workvictor/pixi-digital-rain - Demo in HTML5 Canvas (4)
  • DavidGarciaCat/HTML5-Matrix in HTML (4)
  • [johnnyawesome

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++conways-game-of-lifegame-of-lifemandelbrotmandelbrot-fractal

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言