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
).
- Number falls
- Banner - Show command line arguments by shining characters
- "The Matrix" rain - Wikipedia
- Conway's Game of Life - Wikipedia
- The Mandelbrot set - Wikipedia
- (End scene) "The Matrix" rain
- cxxmatrix in 80x28 - Youtube
- The Mandelbrot set in 479x186 - YouTube
- Highlight scenes - See the animated GIF below
This program is provided under the MIT License.
Requirements:
- git, C++17 compiler, GNU make, GNU awk
- UTF-8 support of the system
- a fast terminal with 256color and UTF-8 support
$ 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
Options
Check the help with cxxmatrix --help
:
$ ./cxxmatrix --help
cxxmatrix (C++ Matrix)
usage: cxxmatrix [OPTIONS...] [[--] MESSAGE...]
MESSAGE
Add a message for 'banner' scene. When no messages are specified, a
message "C++ MATRIX" will be used.
OPTIONS
--help Show help
-- The rest arguments are processed as MESSAGE
-m, --message=MESSAGE
Add a message for 'banner' scene.
-s, --scene=SCENE
Add scenes. Comma separated list of 'number', 'banner', 'rain',
'conway', 'mandelbrot', 'rain-forever' and 'loop'.
-c, --color=COLOR
Set color. One of 'default', 'black', 'red', 'green', 'yellow',
'blue', 'magenta', 'cyan', 'white', and integer 0-255 (256 index
color).
Keyboard
C-c (SIGINT) Quit
C-z (SIGTSTP) Suspend
C-m, RET Show menu
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
$ sudo make install
The default install prefix is /usr/local
. /usr/local/bin/cxxmatrix
and /usr/local/share/man/man1/cxxmatrix.1.gz
will be created.
To change the install prefix, please specify the make variable PREFIX
:
# Example 1
sudo make PREFIX=/opt/cxxmatrix install
# Example 2
make PREFIX=~/.local install
- AUR Package: AUR (en) - cxxmatrix-git by @ignapk
Related tags in GitHub
- abishekvashok/cmatrix - Demo in C (1551)
- will8211/unimatrix - Demo in Python3 (1151)
- akinomyoga/cxxmatrix in C++ (423)
- M4444/TMatrix - Demo in C++ (212)
- GeertJohan/gomatrix - Youtube in Go (210)
- nojvek/matrix-rain - Demo in Node (65)
- torch2424/wasm-matrix - Demo in WASM (49)
- levithomason/cmatrix - Demo in C (49)
- joechrisellis/pmatrix - Demo in Python (29)
- jsbueno/terminal_matrix - Demo in Python (26)
- b166erobot/matrix in Python3 (16)
- amstrad/oh-my-matrix - Demo in Python (15)
- txstc55/matrix_viewer - Demo in C++ (12)
- meganehouser/rustmatrix - Demo in Rust (7)
- aguegu/greenrain - Demo in C++ (6)
- JaydenL33/cmatrix2.0 in C (4)
- Shizcow/smatrix in Rust (1)
- gurushida/matrixmirror - Demo in Objective-C (0)
- tidwall/digitalrain - Demo in HTML5 Canvas (337)
- emilyxxie/green_rain - Demo in HTML5 Canvas (186)
- winterbe/github-matrix - Demo in HTML5 Canvas (178)
- neilcarpenter/Matrix-code-rain - Demo in HTML5 Canvas (88)
- Rezmason/matrix - Demo in HTML5 Canvas (61)
- syropian/HTML5-Matrix-Code-Rain - Demo in HTML5 Canvas (31)
- raphaklaus/matrix-fx - Demo in CSS3 (24)
- pazdera/matrix-vr - Demo in WebVR (17)
- lhartikk/BtcTxMatrix - Demo in HTML5 Canvas (13)
- anderspitman/redpill - Demo in HTML5 Canvas (9)
- pmutua/Matrix-Rain - Demo in HTML5 Canvas (2)
- zhaihaoran/digital-rain - Demo in HTML5 Canvas (1)
- Workvictor/pixi-digital-rain - Demo in HTML5 Canvas (0)
- azder/ES2017-Matrix-Rain - Demo in HTML5 Canvas (0)
- codingotaku/7-Segment-Digital-Matrix-Rain - Demo in HTML5 Canvas (0)
- winterbe/github-matrix-screensaver (github-matrix/WebSaver?) in JavaScript (434)
- tremby/Kaleidoscope-LEDEffect-DigitalRain in Kaleidoscope? (22)
- nathanchere/MatrixSaver in C# (22)
- sapandang/Matrix-Rain-Live-Wallpaper in Android Wallpaper (14)
- Sullivan008/CSharp-MatrixRain in C# (1)
- artgl42/MatrixDigitalRain - Demo in C# (0)