--- title: 'Matrix Rain: 2025 refactor' date: 2025-12-21 layout: post project: true thumbnail: thumb_sm.png --- Unicode support added. ASCII + Katakana working: Algorithm notes: mat.col[] = shuffled column indices, mat.row[] = last row per column. shuffle() sets working set, main loop draws columns via index i (line 333), swap() rotates set. Phosphor decay moved to LSB of RGB union. Should have done this originally. RGB/PD union stays. Little-endian machine, portability not a concern. Charset via UNICODE(min, max) macro - packs range into uint64, insert_code() unpacks and selects random char. Half-width Katakana (U+FF61-U+FF9F) for column alignment. Removed license, automake files. Build: cc -O3 main.c -o matrix Performance: 2% CPU, OpenBSD, T490. Commit: [03f8d87](https://git.asciimx.com/matrix-digital-rain/commit/?id=03f8d87ba7c2e46bd3f3cc4c772fb3a2ac740c92)