{"id":13508741,"url":"https://github.com/akinomyoga/cxxmatrix","last_synced_at":"2025-04-13T00:46:05.085Z","repository":{"id":41366030,"uuid":"245572380","full_name":"akinomyoga/cxxmatrix","owner":"akinomyoga","description":"C++ Matrix: The Matrix Reloaded in Terminals (Number falls, Banners, Matrix rains, Conway's Game of Life and Mandelbrot set)","archived":false,"fork":false,"pushed_at":"2024-06-17T07:23:16.000Z","size":76,"stargazers_count":707,"open_issues_count":2,"forks_count":79,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-13T00:45:56.326Z","etag":null,"topics":["conways-game-of-life","game-of-life","mandelbrot","mandelbrot-fractal","matrix-rain"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akinomyoga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-07T05:10:19.000Z","updated_at":"2025-04-07T06:16:40.000Z","dependencies_parsed_at":"2024-12-21T00:05:19.059Z","dependency_job_id":null,"html_url":"https://github.com/akinomyoga/cxxmatrix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinomyoga%2Fcxxmatrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinomyoga%2Fcxxmatrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinomyoga%2Fcxxmatrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akinomyoga%2Fcxxmatrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akinomyoga","download_url":"https://codeload.github.com/akinomyoga/cxxmatrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248650420,"owners_count":21139672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conways-game-of-life","game-of-life","mandelbrot","mandelbrot-fractal","matrix-rain"],"created_at":"2024-08-01T02:00:57.770Z","updated_at":"2025-04-13T00:46:05.037Z","avatar_url":"https://github.com/akinomyoga.png","language":"C++","funding_links":[],"categories":["C++","others","Fun"],"sub_categories":["RFID"],"readme":"# C++ Matrix in terminal\n\nI wrote a simple terminal program of Matrix digital rain.\nA part of the purpose of this program is to test the performance of terminal emulators.\nAnother purpose is just for fun.\nEnjoy it with fast terminals (e.g., urxvt, alacritty, terminology, etc.)!\n\n**Features**\n\n- Hankaku kana characters as in the original film\n- Ten levels of \"green\"s using terminal 256 color support\n- Twinkling effects by adding random brightness fluctuations\n- Diffused reflection effects by cell background colors\n\n**Scenes**\n\nBy default, the following scenes will be visited in turn.\nIf you want to see each scene, please see the help (`cxxmatrix --help`).\n\n1. Number falls\n2. Banner - Show command line arguments by shining characters\n3. \"The Matrix\" rain - [Wikipedia](https://en.wikipedia.org/wiki/Matrix_digital_rain)\n4. Conway's Game of Life - [Wikipedia](https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life)\n5. The Mandelbrot set - [Wikipedia](https://en.wikipedia.org/wiki/Mandelbrot_set)\n6. (End scene) \"The Matrix\" rain\n\n## Demo\n\n- cxxmatrix in 80x28 - [Youtube](https://www.youtube.com/watch?v=DeKuT8txldc)\n- The Mandelbrot set in 479x186 - [YouTube](https://www.youtube.com/watch?v=RtMy4ltebKw)\n- Highlight scenes - See the animated GIF below\n\n![Captures](https://raw.githubusercontent.com/wiki/akinomyoga/cxxmatrix/images/cxxmatrix-version01sA.gif)\n\n## Usage\n\nThis program is provided under the [MIT License](LICENSE.md).\n\n### Prerequisites\n\n- git, C++17 compiler, GNU make, GNU awk\n- UTF-8 support of the system\n- a fast terminal with `256color` and UTF-8 support\n\n### Compile and Run\n\n```bash\n$ git clone https://github.com/akinomyoga/cxxmatrix.git\n$ cd cxxmatrix\n$ make\n$ ./cxxmatrix 'The Matrix' 'Reloaded'\n```\n\nQuit: \u003ckbd\u003eC-c\u003c/kbd\u003e; Suspend: \u003ckbd\u003eC-z\u003c/kbd\u003e; Menu: \u003ckbd\u003eRET\u003c/kbd\u003e, \u003ckbd\u003eC-m\u003c/kbd\u003e\n\n\n**Compile MSYS2 binary (MSYS2 PTY) using MSYS2**\n\nThe MSYS package `msys2-devel` is required in order to use the MSYS2 compiler.\n\n```bash\nmsys2$ pacman -Syu\nmsys2$ pacman -S git gawk make msys2-devel\nmsys2$ git clone https://github.com/akinomyoga/cxxmatrix.git\nmsys2$ cd cxxmatrix\nmsys2$ PATH=/usr/bin:$PATH make\n```\n\n**Compile Windows binary (ConPTY) using MinGW/MSYS2**\n\nThe Windows binary based on Windows Pseudo Console API (ConPTY) can be compiled on MinGW/MSYS2 by passing `TARGET=win32` to `make`.\nIt should be noted that ConPTY is extremely slow.\n\n```bash\nmsys2$ pacman -Syu\nmsys2$ pacman -S git gawk make mingw-w64-x86_64-gcc\nmsys2$ git clone https://github.com/akinomyoga/cxxmatrix.git\nmsys2$ cd cxxmatrix\nmsys2$ PATH=/mingw64/bin:$PATH make TARGET=win32\n```\n\n### Options\n\nCheck the help with `cxxmatrix --help`:\n\n```console\n$ ./cxxmatrix --help\ncxxmatrix (C++ Matrix)\nusage: cxxmatrix [OPTIONS...] [[--] MESSAGE...]\n\nMESSAGE\n   Add a message for 'banner' scene.  When no messages are specified, a\n   message \"C++ MATRIX\" will be used.\n\nOPTIONS\n   --help      Show help\n   --          The rest arguments are processed as MESSAGE\n   -m, --message=MESSAGE\n               Add a message for 'banner' scene.\n   -s, --scene=SCENE\n               Add scenes. Comma separated list of 'number', 'banner', 'rain',\n               'conway', 'mandelbrot', 'rain-forever' and 'loop'.\n   -c, --color=COLOR\n               Set color. One of 'default', 'black', 'red', 'green', 'yellow',\n               'blue', 'magenta', 'cyan', 'white', integer 0-255 (256 index\n               color), '#RGB', and '#RRGGBB'.\n   --colorspace=COLORSPACE\n               Set colorspace. One of 'default'/'xterm-256'/'256',\n               'ansi-8'/'8', 'aix-16'/'16', 'xterm-88'/'88', 'xterm-rgb',\n               'iso-rgb'/'rgb', 'iso-cmy'/'cmy', 'iso-cmyk'/'cmyk', or\n               'iso-index'/'index'.\n   --frame-rate=NUM\n               Set the frame rate per second.  A positive number less than or\n               equal to 1000. The default is 25.\n   --error-rate=NUM\n               Set the factor for the rate of character changes.  A\n               non-negative number.  The default is 1.0.\n   --diffuse\n   --no-diffuse\n               Turn on/off the background-color effect.  Turned on by default.\n   --twinkle\n   --no-twinkle\n               Turn on/off the twinkling effect.  Turned on by default.\n   --preserve-background\n   --no-preserve-background\n               Preserve terminal background or not.  Not preserved by default.\n   --rain-density=NUM\n               Set the factor for the density of rain drops.  A positive\n               number.  The default is 1.0.\n   --synchronized-update\n   --no-synchronized-update\n               Use the terminal's feature Synchronized Update, DECSET(2026), or\n               not.  Not used by default.\n\nKeyboard\n   C-c (SIGINT), q, Q  Quit\n   C-z (SIGTSTP)       Suspend\n   C-m, RET            Show menu\n```\n\n**Select scenes**\n\n```bash\n# Example: Show the Mandelbrot set\n./cxxmatrix -s mandelbrot\n\n# Example: Loop Number falls and Conway's Game of Life\n./cxxmatrix -s number,conway,loop\n```\n\n## Install\n\n\n```bash\nsudo make install\n```\n\nThe default install prefix is `/usr/local`. The following files will be created:\n\n- `/usr/local/bin/cxxmatrix`\n- `/usr/local/share/man/man1/cxxmatrix.1.gz`\n- `/usr/local/share/licenses/cxxmatrix/LICENSE.md`\n\nThe make variable `PREFIX` can be specified to change the install prefix.\nTo copy files in a temporary location, the make variable `DESTDIR` can also be specified.\nTo change the subdirectory of `LICENSE.md`, the make variable `INSTALL_SUBDIR_LICENSE` (whose detault value is `share/licenses/cxxmatrix`) can be adjusted.\n\n```bash\n# Example 1: install cxxmatrix in user directory\nmake install PREFIX=~/.local\n\n# Example 2: install cxxmatrix in /opt\nsudo make install PREFIX=/opt/cxxmatrix\n\n# Example 3: create a package\nmake install DESTDIR=/tmp/packages/cxxmatrix PREFIX=/usr/local\n\n# Example 4: put LICENSE.md in /usr/local/share/cxxmatrix\nsudo make install INSTALL_SUBDIR_LICENSE=share/cxxmatrix\n```\n\n### See also\n\n- AUR Package: [AUR (en) - cxxmatrix-git](https://aur.archlinux.org/packages/cxxmatrix-git/) by @ignapk\n- FreeBSD Package: [misc/cxxmatrix](https://www.freshports.org/misc/cxxmatrix) by @nunotexbsd (`Nuno Teixeira \u003ceduardo@FreeBSD.org\u003e`)\n\n# Similar projects\n\nRelated tags in GitHub:\n\n- [`#matrix-rain`](https://github.com/topics/matrix-rain)\n- [`#matrix-digital-rain`](https://github.com/topics/matrix-digital-rain)\n\nIn each section, the projects are ordereded by the number of stars, which is shown in parentheses for each project.\nThis list including the numbers of stars is updated when `cxxmatrix` is updated so does not reflect the current status.\nThe numbers of stars are last updated on 2022-03-24 19:57:14 JST.\n\n## The Matrix rains in terminals\n\n- [abishekvashok/cmatrix](https://github.com/abishekvashok/cmatrix) - [Demo](https://github.com/abishekvashok/cmatrix#screencasts) in C (3801)\n- [will8211/unimatrix](https://github.com/will8211/unimatrix) - [Demo](https://github.com/will8211/unimatrix#screenshots) in Python3 (1642)\n- akinomyoga/cxxmatrix - [HN](https://news.ycombinator.com/item?id=22510839) in C++ (671)\n- [st3w/neo](https://github.com/st3w/neo) - [Demo](https://github.com/st3w/neo#neo), [Reddit 1](https://www.reddit.com/r/unixporn/comments/rh45qv/oc_recreate_the_digital_rain_from_the_matrix_in/) [2](https://www.reddit.com/r/linux/comments/rhwqu5/wake_up_neo/) [3](https://www.reddit.com/r/SideProject/comments/rgnq0m/neo_recreate_the_digital_rain_from_the_matrix_in/) [4](https://www.reddit.com/r/terminal_porn/comments/rgoj5f/neo_recreate_the_digital_rain_from_the_matrix_in/) in C++ (620)\n- [nojvek/matrix-rain](https://github.com/nojvek/matrix-rain) - [Demo](https://github.com/nojvek/matrix-rain#screenshots) in Node (434)\n- [M4444/TMatrix](https://github.com/M4444/TMatrix) - [Demo](https://github.com/M4444/TMatrix#how-it-looks), [Reddit](https://www.reddit.com/r/unixporn/comments/btg6rj/oc_tmatrix_a_new_terminal_digital_rain_simulator/) in C++ (376)\n- [cowboy8625/rusty-rain](https://github.com/cowboy8625/rusty-rain) - [Demo](https://github.com/cowboy8625/rusty-rain#----------rusty-rain----), [Reddit](https://www.reddit.com/r/rust/comments/llauze/cross_platform_matrix_rain/) in Rust (338)\n- [GeertJohan/gomatrix](https://github.com/GeertJohan/gomatrix) - [Youtube](https://www.youtube.com/watch?v=mUXFxSmZMis) in Go (284)\n- [domsson/fakesteak](https://github.com/domsson/fakesteak) - [Demo](https://github.com/domsson/fakesteak#fakesteak), [Reddit](https://www.reddit.com/r/unixporn/comments/ju62xa/oc_fakesteak_yet_another_matrix_rain_generator/) in C (102)\n- [levithomason/cmatrix](https://github.com/levithomason/cmatrix) - [Demo](https://github.com/levithomason/cmatrix#cmatrix) in C (84)\n- [jsbueno/terminal_matrix](https://github.com/jsbueno/terminal_matrix) - [Demo](https://github.com/jsbueno/terminal_matrix#python-script-to-simulate-the-matrix-screensaver-effect-in-a-posix-terminal) in Python (73)\n- [torch2424/wasm-matrix](https://github.com/torch2424/wasm-matrix) - [Demo](https://github.com/torch2424/wasm-matrix#wasm-matrix) in WASM (69)\n- [joechrisellis/pmatrix](https://github.com/joechrisellis/pmatrix) - [Demo](https://github.com/joechrisellis/pmatrix#pmatrix-in-action) in Python (42)\n- [amstrad/oh-my-matrix](https://github.com/amstrad/oh-my-matrix) - [Demo](https://github.com/amstrad/oh-my-matrix/blob/master/oh-my-matrix.gif) in Python (24)\n- [tech-chad/pymatrix-rain](https://github.com/tech-chad/pymatrix-rain) - [Demo](https://github.com/tech-chad/pymatrix-rain?tab=readme-ov-file#screen-shots) in Python (24)\n- [txstc55/matrix_viewer](https://github.com/txstc55/matrix_viewer) - [Demo](https://github.com/txstc55/matrix_viewer#matrix-viewer) in C++ (21)\n- [principle105/matrix_rain](https://github.com/principle105/matrix_rain) - [Demo](https://github.com/principle105/matrix_rain) in Python (21)\n- [b166erbot/matrix](https://github.com/b166erbot/matrix) in Python3 (19)\n- [meganehouser/rustmatrix](https://github.com/meganehouser/rustmatrix) - [Demo](https://github.com/meganehouser/rustmatrix#rustmatrix) in Rust (18)\n- [iZucked/Matrix-Rain-An-Image](https://github.com/iZucked/Matrix-Rain-An-Image) - [Demo](https://github.com/iZucked/Matrix-Rain-An-Image?tab=readme-ov-file#examples) in Python (17)\n- [henriquebastos/the-matrix-rain](https://github.com/henriquebastos/the-matrix-rain) - [Demo](https://github.com/henriquebastos/the-matrix-rain#the-matrix-rain) in Python (12)\n- [JaydenL33/cmatrix2.0](https://github.com/JaydenL33/cmatrix2.0) in C (7)\n- [aguegu/greenrain](https://github.com/aguegu/greenrain) - [Demo](https://github.com/aguegu/greenrain#greenrain) in C++ (6)\n- [kevinelong/rain](https://github.com/kevinelong/rain) [Demo](https://github.com/kevinelong/rain#rain), [Youtube](https://www.youtube.com/watch?v=w4mc2xnIKBY), [Reddit](https://www.reddit.com/r/Simulated/comments/l49svb/rain_simulation_on_amber_terminal_window_that_is/) - in Python (3)\n- [stefrush/enterthematrix](https://github.com/stefrush/enterthematrix) - [Demo](https://github.com/stefrush/enterthematrix#enterthematrix) in Python (3)\n- [Shizcow/smatrix](https://github.com/Shizcow/smatrix) in Rust (3)\n- [open-channel-d/digital-rain](https://github.com/open-channel-d/digital-rain) - [Demo](https://github.com/open-channel-d/digital-rain?tab=readme-ov-file#digital-rain) in C++ (2)\n- [artgl42/MatrixDigitalRain](https://github.com/artgl42/MatrixDigitalRain) - [Demo](https://github.com/artgl42/MatrixDigitalRain?tab=readme-ov-file#matrixdigitalrain-dll) in C# (2)\n- [roee30/rmatrix](https://github.com/roee30/rmatrix) in Rust (1)\n- [gurushida/matrixmirror](https://github.com/gurushida/matrixmirror) - [Demo](https://github.com/gurushida/matrixmirror#matrixmirror) in Objective-C (0)\n\n## The Matrix rains in browsers\n\n- [Rezmason/matrix](https://github.com/Rezmason/matrix) - [Demo](https://rezmason.github.io/matrix/), [HN](https://news.ycombinator.com/item?id=28446761) in HTML5 Canvas (3244)\n- [tidwall/digitalrain](https://github.com/tidwall/digitalrain) - [Demo](https://tidwall.com/digitalrain/) in HTML5 Canvas (380)\n- [emilyxxie/green_rain](https://github.com/emilyxxie/green_rain) - [Demo](http://xie-emily.com/generative_art/green_rain.html) in HTML5 Canvas (262)\n- [winterbe/github-matrix](https://github.com/winterbe/github-matrix) - [Demo](https://winterbe.com/projects/github-matrix/) in HTML5 Canvas (209)\n- [neilcarpenter/Matrix-code-rain](https://github.com/neilcarpenter/Matrix-code-rain) - [Demo](http://neilcarpenter.com/demos/canvas/matrix/) in HTML5 Canvas (107)\n  - [janemiceli/matrix](https://github.com/janemiceli/matrix) - [Demo](https://janemiceli.github.io/matrix/) (9)\n  - [janemiceli/matrix4rainbow](https://github.com/janemiceli/matrix4rainbow) - [Demo](https://janemiceli.github.io/matrix4rainbow/) (1)\n  - [janemiceli/Happy_birthday_angie](https://github.com/janemiceli/Happy_birthday_angie) - [Demo](https://janemiceli.github.io/Happy_birthday_angie/) (1)\n- [syropian/HTML5-Matrix-Code-Rain](https://github.com/syropian/HTML5-Matrix-Code-Rain) - [Demo](https://codepen.io/syropian/pen/bLzAi) in HTML5 Canvas (34)\n- [raphaklaus/matrix-fx](https://github.com/raphaklaus/matrix-fx) - [Demo](https://raphaklaus.com/matrix-fx/) in CSS3 (28)\n- [pazdera/matrix-vr](https://github.com/pazdera/matrix-vr) - [Demo](https://radek.io/matrix-vr/) in WebVR (26)\n- [C-o-d-e-C-o-w-b-o-y/matrix-rain-background-react](https://github.com/C-o-d-e-C-o-w-b-o-y/matrix-rain-background-react) - [Demo](https://www.youtube.com/watch?v=qLbQ0NBa5zM) in React (22)\n- [lhartikk/BtcTxMatrix](https://github.com/lhartikk/BtcTxMatrix) - [Demo](http://lhartikk.github.io/btctxmatrix/) in HTML5 Canvas (14)\n- [Rudxain/RGB-digital-rain](https://github.com/Rudxain/RGB-digital-rain) - [Demo](https://rudxain.github.io/RGB-digital-rain/) in HTML5 Canvas (14)\n- [anderspitman/redpill](https://github.com/anderspitman/redpill) - [Demo](https://anderspitman.net/apps/redpill/) in HTML5 Canvas (9)\n- [zhaihaoran/digital-rain](https://github.com/zhaihaoran/digital-rain) - [Demo](https://zhaihaoran.github.io/digital-rain/) in HTML5 Canvas (6)\n- [Workvictor/pixi-digital-rain](https://github.com/Workvictor/pixi-digital-rain) - [Demo](https://victorpunko.ru/development/digital-rain-v3/) in HTML5 Canvas (4)\n- [DavidGarciaCat/HTML5-Matrix](https://github.com/DavidGarciaCat/HTML5-Matrix) in HTML (4)\n- [johnnyawesome/MatrixRain](https://github.com/johnnyawesome/MatrixRain) (3)\n- [pmutua/Matrix-Rain](https://github.com/pmutua/Matrix-Rain) - [Demo](https://pmutua.github.io/Matrix-Rain/) in HTML5 Canvas (2)\n- [no-cmyk/matrix-code-lines](https://github.com/no-cmyk/matrix-code-lines) (2)\n- [azder/ES2017-Matrix-Rain](https://github.com/azder/ES2017-Matrix-Rain) - [Demo](https://azder.github.io/ES2017-Matrix-Rain/) in HTML5 Canvas (1)\n- [codingotaku/7-Segment-Digital-Matrix-Rain](https://github.com/codingotaku/7-Segment-Digital-Matrix-Rain) - [Demo](https://codingotaku.com/7-Segment-Digital-Matrix-Rain/) in HTML5 Canvas (0)\n- [attilabuti/matrix1k](https://github.com/attilabuti/matrix1k) - [Demo](https://attilabuti.com/p/matrix1k) in JavaScript (0)\n\n## Others\n\n- [winterbe/github-matrix-screensaver](https://github.com/winterbe/github-matrix-screensaver) (github-matrix/WebSaver?) in JavaScript (567)\n- [nathanchere/MatrixSaver](https://github.com/nathanchere/MatrixSaver) in C# (24)\n- [tremby/Kaleidoscope-LEDEffect-DigitalRain](https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain) in Kaleidoscope? (19)\n- [sapandang/Matrix-Rain-Live-Wallpaper](https://github.com/sapandang/Matrix-Rain-Live-Wallpaper) in Android Wallpaper (17)\n- [artgl42/MatrixDigitalRain](https://github.com/artgl42/MatrixDigitalRain) - [Demo](https://github.com/artgl42/MatrixDigitalRain#matrixdigitalrain-dll) in C# (2)\n- [Antithesise/Matrix-Rain](https://github.com/Antithesise/Matrix-Rain) ??? in Python (4)\n- [Sullivan008/CSharp-MatrixRain](https://github.com/Sullivan008/CSharp-MatrixRain) in C# (1)\n- [vdechenaux/bootable-matrix-rain](https://github.com/vdechenaux/bootable-matrix-rain) - [Demo](https://github.com/vdechenaux/bootable-matrix-rain?tab=readme-ov-file#demo) in asm (1)\n\n## Videos\n\n- [Chuvas da Matrix - YouTube](https://www.youtube.com/watch?v=y9wD8Nck1VA)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakinomyoga%2Fcxxmatrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakinomyoga%2Fcxxmatrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakinomyoga%2Fcxxmatrix/lists"}