From abf2ae336b780ac206e3f5d55b608703c9d807d5 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Wed, 24 Dec 2025 18:23:30 +0800 Subject: Matrix --- _site/log/matrix-digital-rain/index.html | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to '_site/log') diff --git a/_site/log/matrix-digital-rain/index.html b/_site/log/matrix-digital-rain/index.html index 16b96be..659922d 100644 --- a/_site/log/matrix-digital-rain/index.html +++ b/_site/log/matrix-digital-rain/index.html @@ -51,10 +51,10 @@ stored in a dedicated array–still don’t understand why I did that when I had already used bit-packing for the RGB channels; The algorithm was difficult to decipher. The 2022 version worked, but that’s not the same thing as correct.

-

I began by placing the decay factor in the LSB of the 4-byte RGB value. Let’s -call that RGB-PD. PD plays a somewhat analogous role to an alpha channel in -that both influence transparency. However, they work very differently. So, I -avoided labelling it A so as not to cause confusion:

+

I began by placing the decay factor in the LSB of the 4-byte RGB value. The PD +value plays a somewhat analogous role to an alpha channel in that both +influence transparency. However, they work very differently. So, I avoided +labelling it A so as not to cause confusion:

enum {
     R,  /* Red   */
@@ -129,8 +129,7 @@ static inline void insert_code(matrix *mat,
 first codepoint and the high four bytes the last. Here, I chose bitwise
 operations over unions because, first and foremost, the operations themselves
 are trivial and idiomatic, and the UNICODE() macro simplifies the management of
-charsets. The insert_code() function is now ready to take its rightful place
-next to blend().

+charsets.

The init_term() function is the arbiter of this zero-dependency software. It prepares the graphical environment so that I can interact with it via ANSI @@ -158,8 +157,6 @@ escape codes instead of unnecessary layers of abstraction:

}
-

All credit for the terminal control function belongs to Domsson, whose Fakesteak inspired my own three years ago.

-

insert_code() seeds the Matrix, blend() creates the old monochrome CRT display nostalgia, and ANSI control sequences paint the screen. The result is a digital rain that captures the original Matrix aesthetic with high visual fidelity:

-- cgit v1.2.3