
Created 2026-09-03
ASCII Art
/**
* ============================================================================
* = Box-Drawing Writing =
* ============================================================================
*
* Unicode box-drawing characters live in a tight range of code points. Treat
* those codes as numbers, and a little arithmetic becomes a writing generator:
* round a code to get a glyph, add noise to pick among its neighbors.
*
* Pick a pattern with the radio — the grid fills in character by character.
* Scroll down for a static catalog with the math behind each formula.
*
* The whole trick is `char` and `rand`:
*
* - `char(x)` rounds `x` and looks up that Unicode code point
* - `rand(n)` is noise in `[-n/2, n/2)`
* - `round(rand(1) + 0.5)` is a coin flip: `0` or `1`
*
* Shifting the base (`9585.1` vs `9585.5`) biases which glyph wins. Multiplying
* the coin flip stretches the jump, so you can hop from ╱ to ╳, or from ━ to ┓.
*/
// prettier-ignore
const index = recho.radio(3, [
0, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10
]);
const pattern = [
() => char(9585), // 0. "╱"
() => char(9586), // 1. "╲"
() => char(9585) + char(9586), // 2. "╱╲"
() => char(9585.5 + rand(1)), // 3. "╱", "╲"
() => char(9585.1 + rand(1)), // 4. "╱", "╲"
() => char(9585 + round(rand(1) + 0.5) * 2), // 5. "╱", "╳"
() => char(9472 + round(rand(1) + 0.5) * 2), // 6. "│", "─"
() => char(9473 + round(rand(1) + 0.5) * 18), // 7. "┓", "━"
() => char(9620.5 + rand(1)), // 8. "▔", "▕"
() => char(9626 + round(rand(1) + 0.5) * 4), // 9. "▚", "▞"
() => char(9581 + round(rand(1) + 0.5) * 1), // 10. "╮", "╭"
];
const compact = [false, false, false, false, false, false, true, false, true, true, false];
//➜ ╲╲╲╲╱╱╱╱╲╲╲╲╱╱╲╲╲╱╱╲╱╱╲╱╲╲╱╲╲╱╱╱╱╲╱╱╲╲╱╱
//➜ ╱╲╱╱╱╲╲╲╲╲╲╲╱╲╱╱╲╲╱╱╱╲╱╲╲╲╱╱╱╲╱╲╲╱╲╱╱╱╱╲
//➜ ╲╱╱╲╲╱╱╱╱╲╱╱╱╱╱╱╱╱╲╲╱╱╱╲╲╲╲╱╲╲╲╱╱╱╱╲╱╲╲╲
//➜ ╱╱╱╱╲╲╲╱╲╱╲╲╲╱╲╱╱╲╲╱╱╱╱╱╲╱╱╲╱╱╲╲╱╲╱╲╱╱╲╲
//➜ ╱╲╱╱╱╲╱╱╱╲╲╱╱╱╲╲╲╲╱╲╱╲╲╱╲╱╲╲╲╱╱╲╲╲╲╱╱╱╲╲
//➜ ╲╲╲╱╲╱╲╱╲╲╲╲╲╱╲╲╲╲╱╲╱╲╱╲╱╲╲╱╱╲╱╲╲╲╲╱╲╲╱╲
//➜ ╱╱╱╲╱╱╲╱╱╲╲╲╱╱╲╲╱╲╲╱╲╲╱╲╲╱╱╱╲╲╲╱╱╱╲╱╲╲╲╲
//➜ ╱╱╲╱╱╱╱╱╱╲╱╱╱╱╲╱╲╱╲╱╱╲╲╲╲╲╲╲╱╲╲╲╲╲╲╲╱╱╲╱
//➜ ╲╱╲╱╲╱╲╲╲╱╲╲╲╲╱╲╱╲╲╱╱╲╲╱╱╲╱╱╱╲╱╲╱╱╲╲╲╲╱╱
//➜ ╱╱╲╲╱╲╲╲╲╱╱╲╱╱╱╱╲╲╲╱╱╲╲╲╱╱╲╱╲╱╱╱╱╲╱╱╱╱╱╲
animateMatrix(pattern[index], compact[index]);
/**
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Pattern Catalog
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Each formula below is one entry from `pattern`. Solid fills use a single
* code point; the rest add noise so neighboring glyphs mix into writing.
*/
/**
* 0. Always ╱ — U+2571, no noise.
*/
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
matrix(() => char(9585));
/**
* 1. Always ╲ — U+2572, the neighbor of ╱.
*/
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
//➜ ╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲╲
matrix(() => char(9586));
/**
* 2. Concatenate both glyphs. Each callback emits two characters, so the
* grid is a strict ╱╲ stripe instead of a random mix.
*/
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
//➜ ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
matrix(() => char(9585) + char(9586));
/**
* 3. Center the noise on 9585.5 so ╱ and ╲ appear about equally.
*/
//➜ ╲╱╱╲╲╱╱╲╱╲╱╱╱╲╱╱╲╲╲╱╲╱╱╲╱╱╱╲╲╱╱╱╲╲╱╱╱╲╲╱
//➜ ╱╲╲╲╲╲╲╲╱╱╲╲╲╲╱╱╱╱╱╲╲╱╱╱╱╱╱╱╱╱╱╱╱╲╱╲╱╲╲╲
//➜ ╲╱╱╲╱╱╲╱╲╱╱╲╱╲╱╱╱╲╱╱╲╱╲╲╱╱╱╱╱╲╱╱╲╲╲╲╱╱╱╱
//➜ ╱╲╱╲╱╲╱╱╲╱╲╲╱╱╱╱╱╱╲╲╱╲╱╲╱╱╱╱╲╲╲╲╱╱╱╲╱╲╱╲
//➜ ╲╲╲╲╲╲╲╱╲╲╲╲╲╲╲╱╱╲╲╲╲╲╱╱╲╲╱╱╱╱╱╱╱╱╱╲╱╱╱╲
//➜ ╱╱╱╱╱╲╱╱╱╲╲╱╱╲╲╲╱╲╱╲╱╱╱╱╱╲╲╱╱╲╱╱╲╱╱╱╱╲╱╲
//➜ ╱╲╱╱╱╱╱╱╲╲╲╱╲╲╱╱╱╲╱╱╱╲╲╱╲╲╲╲╲╱╲╱╱╲╲╲╱╱╲╱
//➜ ╲╱╱╱╲╱╲╱╲╱╱╱╲╱╲╱╱╲╱╲╲╱╲╲╲╲╲╲╲╱╲╱╲╱╱╲╲╱╲╱
//➜ ╱╱╲╲╲╱╱╱╲╲╲╲╲╲╲╱╲╲╱╲╱╱╲╲╱╲╱╲╱╱╲╱╱╲╱╱╲╱╱╱
//➜ ╱╲╱╲╲╲╱╲╲╱╱╱╲╱╱╲╲╱╲╱╲╱╱╲╱╲╲╲╲╱╲╲╲╱╲╲╱╲╱╱
//➜ ╲╲╱╱╲╱╲╱╱╱╲╲╱╲╱╲╱╲╲╲╱╱╲╱╱╲╱╱╱╲╱╲╱╲╱╱╱╲╲╱
//➜ ╱╱╲╱╲╱╲╱╲╱╱╲╲╱╱╱╱╱╲╱╲╲╱╲╱╲╲╲╲╱╲╱╱╲╲╱╲╲╱╲
//➜ ╲╱╱╱╱╱╱╲╲╱╲╲╱╱╲╲╱╱╲╲╲╲╲╲╱╲╲╲╲╱╲╱╱╱╱╱╱╲╱╱
//➜ ╲╲╲╲╲╲╱╱╱╱╲╲╲╲╱╲╱╱╱╱╱╲╲╲╲╱╲╱╲╱╲╲╲╱╱╲╱╱╱╲
//➜ ╱╱╱╲╱╲╲╱╱╲╱╱╱╱╲╲╲╲╱╲╱╱╲╱╲╱╱╲╲╱╲╱╱╲╱╲╲╱╲╲
//➜ ╱╲╲╲╲╱╱╲╲╱╲╱╱╲╲╱╱╲╱╲╱╲╲╱╱╲╱╲╱╱╲╱╱╱╲╲╱╱╱╲
matrix(() => char(9585.5 + rand(1)));
/**
* 4. Center closer to ╱ (9585.1). Most cells stay ╱; ╲ appears as sparse noise.
*/
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╲╲╲╲╱╲╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╲╱╲╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲
//➜ ╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱
//➜ ╱╱╱╲╱╱╱╱╱╱╱╲╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱
//➜ ╲╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱
//➜ ╱╱╱╱╲╱╱╱╱╱╲╱╱╲╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱
//➜ ╱╱╱╲╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╲╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╲╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱
//➜ ╱╱╲╱╱╱╱╱╱╱╲╱╲╱╱╲╱╱╱╱╱╲╱╱╱╱╱╲╱╱╱╱╱╱╲╱╱╲╱╱
//➜ ╱╱╱╱╱╱╱╱╲╱╱╲╱╱╱╱╱╱╱╱╱╱╱╲╱╲╲╲╲╱╱╱╱╱╱╱╱╱╱╱
//➜ ╲╱╱╱╱╱╱╱╲╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╲╱
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╲╱╱╲
//➜ ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╲╱╱╱╱╱╱╱╱╱╱╱╱╱╱╲╱╱╱╲╱╱
matrix(() => char(9585.1 + rand(1)));
/**
* 5. Coin flip × 2 jumps from ╱ (9585) to ╳ (9587), skipping ╲.
*/
//➜ ╱╱╱╳╳╳╱╳╳╱╳╱╳╱╱╳╱╳╳╳╳╱╳╳╱╳╳╳╳╳╱╱╱╳╱╱╱╳╱╳
//➜ ╳╳╳╳╳╱╱╱╳╱╳╳╱╳╱╳╱╱╳╱╱╱╳╳╱╳╳╳╱╳╱╳╳╱╳╱╱╳╳╱
//➜ ╳╱╳╳╱╱╱╳╱╳╳╱╳╱╱╳╳╱╱╳╱╱╳╱╱╳╳╱╱╱╱╳╳╳╳╱╳╳╳╳
//➜ ╱╱╳╱╱╱╳╱╳╱╳╱╱╱╳╳╱╳╱╳╳╱╱╱╱╱╳╳╳╱╱╱╱╱╱╱╱╱╳╱
//➜ ╳╳╱╳╳╱╱╳╳╳╱╱╱╱╱╳╱╱╱╱╱╳╳╱╱╳╳╳╳╱╱╱╳╱╱╱╳╱╱╳
//➜ ╱╳╱╳╱╱╳╳╳╱╳╱╱╱╱╳╳╳╳╳╱╳╱╱╳╳╱╱╳╱╱╱╱╱╱╱╱╱╱╳
//➜ ╳╱╱╱╳╱╱╳╳╱╳╳╳╱╳╱╱╱╱╳╱╳╱╳╱╱╳╳╱╱╳╳╱╱╳╱╱╱╳╱
//➜ ╱╳╱╳╱╳╱╱╳╱╳╳╳╳╳╳╳╳╳╳╳╳╱╳╱╱╱╳╳╳╳╱╳╳╳╳╱╳╱╳
//➜ ╳╱╱╱╱╳╳╳╳╳╱╳╱╳╱╱╳╳╳╱╳╳╳╳╳╳╱╳╳╳╳╱╱╳╳╳╱╳╱╱
//➜ ╱╱╳╱╱╱╳╱╱╳╳╳╱╱╱╱╱╱╱╳╱╳╳╱╱╳╳╳╱╳╱╳╳╱╱╳╱╱╱╱
//➜ ╱╱╱╱╳╳╱╳╳╳╳╱╱╳╳╱╳╳╳╳╳╳╱╳╱╱╳╳╱╳╱╳╱╱╳╳╳╱╳╱
//➜ ╳╳╱╳╳╳╱╱╳╱╳╱╱╱╱╳╱╱╳╳╳╳╱╱╳╳╱╱╳╳╳╱╱╱╳╱╳╳╱╱
//➜ ╱╱╱╳╱╱╱╱╳╳╳╳╳╳╳╳╱╱╱╳╱╳╳╳╱╳╱╱╱╳╳╳╳╳╳╱╳╳╳╱
//➜ ╳╱╱╱╱╳╱╳╳╳╱╳╳╳╱╱╳╳╳╳╳╳╱╳╱╱╱╱╳╱╱╱╱╱╱╳╱╳╱╱
//➜ ╱╱╱╳╳╳╳╱╳╱╳╱╳╳╱╱╳╳╳╱╳╱╳╳╱╳╳╱╳╱╳╱╱╳╱╱╳╱╱╳
//➜ ╱╱╳╳╳╱╱╱╱╱╳╳╳╱╱╳╱╳╱╳╱╳╱╱╱╱╱╱╱╳╱╳╱╱╳╳╱╱╳╱
matrix(() => char(9585 + round(rand(1) + 0.5) * 2));
/**
* 6. Light box-drawing: ─ (9472) or │ (9474). Compact line-height lets the
* strokes meet.
*/
//➜ │───│─││──│─││─││││││──││─│││───││─│─│─│
//➜ │───││─││─│─│─│─│──│─│──│──│─││││─│││─│─
//➜ │││─││─│││───│───│││─│─│││─│──│────│││──
//➜ │─│───│──│││────│││───│──││││─│───││││──
//➜ │────│───│───│─│││─│││─│││─│────────│──│
//➜ │─││───│││───│─│──│───│││─│─│─│───│─││││
//➜ │─────│─││││─────││─│───│─│─│──││─│─│──│
//➜ │││─││─│─│││││─││───│─││──││──│─│──││││─
//➜ ─│─││───│││─│││││─│─│──│────│─│──│─│││─│
//➜ ──│││─│─│──││──────│─│───│───││─││││──││
//➜ │────│──│───│││──││──││───────│─│───││──
//➜ │─│──│────││─││──│──││──││──││─││││││││─
//➜ │──│─│───│─││─││─│─│────││││─││─││─│──││
//➜ ──│───│││││──│───│───│──││─│─│││─│──││─│
//➜ ─││────────│││││─│───│───│──│──│─││─────
//➜ ││─│──│││─│─│──│─│││───││─││││───││────│
compactMatrix(() => char(9472 + round(rand(1) + 0.5) * 2));
/**
* 7. Heavy box-drawing: ━ (9473) or ┓ (9491 = 9473 + 18).
*/
//➜ ┓━━━┓━┓┓┓┓━┓┓┓┓━━━━┓┓┓┓┓┓━┓━━━━━┓━┓━━┓━━
//➜ ┓━┓━━━┓━━┓┓━━┓┓━┓━━┓━━━━┓┓┓━┓━┓┓┓┓━┓━┓┓━
//➜ ━━┓┓━┓━┓━━━━┓━━━━┓━┓━┓┓━┓┓┓━┓━┓━┓┓━━━┓┓┓
//➜ ┓━━┓┓┓┓━┓┓━┓┓━━━━━━┓━┓┓┓━━┓━━┓━━━━━┓┓┓━━
//➜ ┓━┓━┓┓┓━━┓┓┓━━━━┓━┓┓━━━━┓━┓┓━┓━┓━━┓━┓┓┓━
//➜ ┓━┓┓━━━┓┓━━━━┓┓┓┓┓┓┓━━━┓━━┓━┓┓━┓┓┓┓━━┓┓━
//➜ ━━┓━┓┓━━┓┓━┓┓┓━┓━━┓┓┓━━━━┓━┓━━━┓┓┓━━┓┓━━
//➜ ┓┓┓┓┓┓━┓━┓━┓┓┓━┓┓━┓━┓┓┓━━┓━━┓┓┓━━┓━━━━┓┓
//➜ ━━━┓┓┓┓━┓━┓━┓┓━┓┓┓┓┓━━━━━━┓┓━┓┓━┓┓┓┓━┓━━
//➜ ━┓━━┓━┓┓┓━━━━┓━┓┓━━━┓┓━┓┓━━┓━━┓━━━━━┓━━┓
//➜ ┓━━┓━┓━┓┓┓━┓┓┓━┓━━┓━┓━━━━━━━┓━━━━┓━┓┓┓┓┓
//➜ ┓━┓━┓━┓┓┓━━┓┓━━┓━━━┓━┓┓━━━━━━┓┓┓━┓┓━┓┓━┓
//➜ ┓━┓┓━━┓┓━━━┓━┓━━━┓━━┓━━━┓┓━━━┓━┓┓━┓┓┓┓━━
//➜ ┓━━┓┓┓┓━┓━┓━┓━┓┓┓┓┓━━━━┓━┓┓━━┓━┓━┓┓━━━┓━
//➜ ━┓━━┓┓━━┓┓┓━┓┓━━┓┓┓━━━┓┓━┓┓┓━━┓┓┓━┓┓┓┓┓━
//➜ ━━━┓━━━━━━┓━━┓┓━━━┓━┓┓━━━┓┓━┓━━┓┓━┓┓━━━┓
matrix(() => char(9473 + round(rand(1) + 0.5) * 18));
/**
* 8. Upper / right one-eighth blocks: ▔ (9620) and ▕ (9621).
*/
//➜ ▔▔▕▔▕▔▔▔▔▕▕▔▔▔▕▔▔▔▔▔▕▔▔▕▔▕▔▕▔▕▔▕▕▕▕▕▕▕▕▕
//➜ ▕▔▔▔▔▕▕▔▕▔▕▔▕▕▔▕▔▕▔▕▕▕▕▕▕▕▔▔▔▕▕▕▕▔▕▔▔▕▕▕
//➜ ▕▔▕▔▕▕▕▕▕▕▕▔▕▕▕▕▕▔▕▔▔▕▕▔▕▔▔▔▕▔▕▔▔▔▔▔▕▔▔▔
//➜ ▔▕▔▕▕▕▔▕▕▔▔▔▔▔▕▕▕▔▕▕▔▕▕▔▔▕▕▔▕▕▔▔▔▔▔▕▔▕▔▔
//➜ ▔▕▔▔▔▕▕▕▕▔▔▔▔▕▕▔▔▕▕▕▕▔▕▕▔▔▕▕▕▕▕▕▔▕▔▔▔▕▔▕
//➜ ▔▔▔▕▔▕▕▔▔▕▔▔▕▔▔▔▕▕▔▔▕▕▔▔▕▕▔▔▔▕▔▕▕▕▔▕▕▕▕▕
//➜ ▕▔▔▔▔▔▔▕▔▔▔▔▔▕▔▔▔▔▕▔▔▕▔▔▕▔▔▔▔▔▔▔▕▕▔▕▔▔▔▔
//➜ ▕▔▕▔▕▕▕▔▕▕▔▔▔▕▕▕▕▕▕▕▕▕▔▔▔▔▔▕▕▕▔▔▕▕▔▔▔▕▔▕
//➜ ▔▔▕▕▕▕▕▔▔▔▕▕▕▕▔▔▕▕▕▕▔▔▕▕▕▕▕▔▕▔▕▕▕▕▕▔▔▕▔▔
//➜ ▔▕▕▕▔▔▕▔▔▕▕▕▕▔▔▔▕▕▕▕▔▕▔▕▔▕▔▕▕▔▔▔▕▕▔▔▕▕▕▔
//➜ ▔▕▕▕▔▔▕▔▕▕▔▕▔▔▕▔▔▕▕▔▔▔▔▔▕▕▕▔▕▔▕▔▕▕▔▔▕▔▔▕
//➜ ▕▕▔▕▕▕▔▕▕▕▔▔▕▕▕▕▔▕▔▔▕▕▕▕▕▔▕▕▕▕▔▕▔▕▔▔▕▔▕▕
//➜ ▕▔▕▔▔▔▔▔▕▔▕▔▔▔▕▔▔▔▕▕▕▔▕▕▕▔▔▔▔▕▔▕▔▕▔▔▕▔▔▔
//➜ ▔▔▔▕▕▕▕▔▕▔▕▔▕▔▕▕▕▔▕▕▔▔▔▔▔▕▔▔▕▕▔▕▔▕▕▔▔▔▔▔
//➜ ▕▔▕▕▕▕▕▕▕▕▔▕▔▕▔▕▔▔▕▕▕▕▕▔▕▔▕▕▕▔▔▔▔▕▔▔▕▕▕▔
//➜ ▔▔▕▕▔▕▕▔▕▕▕▔▔▔▔▔▕▕▔▕▔▔▕▕▔▕▕▔▕▔▕▔▕▔▔▔▔▕▕▔
compactMatrix(() => char(9620.5 + rand(1)));
/**
* 9. Quadrant blocks: ▚ (9626) or ▞ (9630 = 9626 + 4).
*/
//➜ ▚▞▚▞▚▚▚▞▚▚▚▞▞▚▞▚▚▞▚▚▞▞▞▞▞▚▞▞▚▞▞▞▚▞▚▞▚▚▚▞
//➜ ▚▞▚▞▞▞▞▚▚▞▞▞▚▚▞▚▚▞▚▚▚▚▚▞▚▚▞▞▞▚▞▚▚▞▚▚▚▚▞▞
//➜ ▚▚▚▞▞▞▞▚▞▞▚▞▚▞▞▞▚▞▞▞▚▚▞▚▚▚▚▚▞▚▞▞▚▞▚▞▞▚▚▞
//➜ ▞▚▚▞▚▞▞▚▚▚▚▚▚▞▞▚▞▚▞▚▞▞▞▞▞▚▚▚▚▞▚▞▚▞▚▚▞▚▚▚
//➜ ▚▞▞▞▚▞▞▚▞▚▚▚▚▚▚▞▚▚▞▚▚▞▚▚▚▚▞▚▚▞▞▚▚▚▞▞▞▚▚▚
//➜ ▚▞▞▚▚▚▚▚▚▞▚▚▚▞▞▞▞▞▞▚▞▞▞▞▚▚▚▚▞▞▚▚▞▞▚▞▚▞▚▞
//➜ ▚▞▚▚▞▞▚▚▚▞▚▚▚▞▚▞▞▚▞▞▚▚▚▚▞▚▞▞▚▚▞▚▞▚▞▞▞▚▞▚
//➜ ▞▞▞▚▞▞▚▞▚▚▞▚▞▞▞▞▚▚▚▚▞▚▞▞▚▞▞▞▞▚▞▚▞▞▚▞▞▞▞▞
//➜ ▞▞▚▚▞▚▚▞▚▞▚▞▞▞▚▞▞▞▞▞▞▞▚▞▚▚▞▞▞▞▚▚▚▞▞▞▚▞▚▞
//➜ ▚▚▚▞▚▚▚▚▞▞▞▚▞▚▚▞▚▞▚▚▚▚▞▞▞▞▚▞▚▞▚▞▞▞▚▞▚▚▞▞
//➜ ▞▞▞▚▚▞▚▚▚▞▚▚▚▞▚▞▚▞▚▚▚▚▞▞▚▞▞▞▞▞▚▞▞▞▞▚▞▞▞▞
//➜ ▚▚▞▞▞▚▞▞▚▞▞▞▚▞▞▚▚▞▚▚▚▚▞▞▚▚▞▞▚▚▞▞▞▞▚▞▚▚▞▞
//➜ ▞▞▞▚▚▚▚▚▞▚▚▚▚▚▞▞▞▚▞▚▞▚▚▚▞▞▚▚▚▚▚▞▚▚▞▚▞▞▞▞
//➜ ▚▞▚▚▞▞▞▚▚▞▞▚▚▞▞▚▞▞▚▚▞▞▞▚▞▞▞▚▚▚▚▞▞▚▞▚▚▞▚▚
//➜ ▞▞▞▞▚▚▞▚▚▚▚▞▞▚▚▞▞▞▞▚▞▞▞▚▚▞▞▚▞▞▞▞▞▞▚▚▞▚▚▞
//➜ ▚▚▚▚▞▚▞▚▞▚▞▞▚▚▞▞▞▚▚▞▞▞▞▚▚▞▞▚▞▚▚▞▚▚▚▞▚▚▞▚
compactMatrix(() => char(9626 + round(rand(1) + 0.5) * 4));
/**
* 10. Arc corners: ╮ (9581) or ╭ (9582).
*/
//➜ ╭╭╮╮╭╭╮╭╭╭╭╭╭╮╭╮╭╮╭╭╮╭╮╮╭╭╮╭╭╭╭╮╮╮╮╭╭╭╭╮
//➜ ╮╮╮╮╭╮╮╮╭╭╭╭╭╭╭╮╭╭╮╭╮╭╮╭╭╭╮╮╭╭╭╭╭╮╮╭╭╭╭╭
//➜ ╮╮╮╭╮╮╭╮╮╮╭╭╭╭╮╭╭╭╮╮╭╮╭╮╮╮╮╭╮╮╮╭╮╮╭╭╭╮╮╭
//➜ ╮╭╭╭╭╭╮╮╮╭╭╭╮╮╮╮╮╭╮╮╭╮╭╭╮╮╭╮╭╮╮╮╭╭╮╮╮╭╮╭
//➜ ╮╮╭╮╭╮╭╭╮╭╮╭╭╮╭╮╮╭╮╮╭╭╭╮╭╮╮╭╮╮╭╮╭╮╮╮╭╭╮╭
//➜ ╭╮╮╮╭╮╮╮╭╮╮╮╭╭╮╭╭╭╭╭╮╮╭╮╭╭╮╭╭╭╮╭╭╭╮╭╭╮╭╮
//➜ ╮╮╮╮╮╮╮╮╮╭╭╮╮╮╭╭╭╮╮╮╭╭╮╭╭╮╮╮╮╮╭╭╮╮╮╮╭╭╭╭
//➜ ╭╮╭╭╭╭╮╭╭╭╭╮╭╭╮╮╭╮╭╮╮╮╮╭╭╮╭╭╭╮╭╭╭╮╮╮╭╭╮╭
//➜ ╭╮╭╮╭╮╮╭╮╭╮╭╮╮╭╮╮╮╭╭╭╮╮╮╮╮╭╭╭╮╭╮╭╭╮╮╭╮╭╮
//➜ ╭╭╭╭╭╭╭╮╭╮╭╭╮╭╮╮╭╮╮╮╮╭╭╭╭╮╮╭╭╭╭╭╮╮╭╭╭╮╭╭
//➜ ╮╭╭╮╮╭╭╭╮╭╮╭╭╭╭╭╭╮╭╮╭╮╭╮╮╮╮╭╮╭╮╮╭╭╭╭╭╭╭╮
//➜ ╮╮╮╭╮╭╭╭╮╮╭╮╮╭╮╮╮╭╮╮╮╮╮╭╮╭╭╮╮╭╭╮╭╭╮╭╮╭╭╮
//➜ ╮╭╭╭╮╭╮╮╮╮╭╭╮╭╭╭╮╮╮╮╭╭╮╭╭╮╭╮╭╭╭╭╭╮╮╭╭╮╮╮
//➜ ╭╭╭╮╭╮╭╭╮╮╮╭╮╮╭╮╭╮╭╮╮╮╭╮╮╭╭╮╮╭╭╮╮╭╭╭╮╮╮╭
//➜ ╭╮╮╮╭╮╭╮╭╭╮╭╭╮╮╮╭╮╭╭╮╭╭╮╮╮╭╮╮╮╮╮╭╮╭╮╮╮╮╭
//➜ ╭╮╭╮╮╭╭╭╮╭╮╭╭╭╮╭╭╮╭╮╮╭╮╭╭╮╮╮╮╭╭╭╮╭╭╮╭╮╮╭
matrix(() => char(9581 + round(rand(1) + 0.5) * 1));
/**
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Helpers
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
const char = (x) => String.fromCharCode(round(x));
const round = Math.round;
function compactMatrix(callback, n) {
matrix(callback, true, n);
}
function matrix(callback, compact = false, n = 40) {
for (let i = 0; i < n * 0.4; i++) {
let output = "";
while (output.length < n) {
output += callback();
}
print(output, compact);
}
}
function animateMatrix(callback, compact = false, n = 40) {
let output = "";
let i = 0;
const timer = setInterval(() => {
if (i > n * n * 0.25 - 1) return clearInterval(timer);
echo.clear();
const j = i % n;
const v = callback();
output += v;
if (j >= n - v.length) output += "\n";
echo.set("compact", compact)(recho.inspect(output.trim(), {quote: false}));
i += v.length;
}, 15);
echo.dispose(() => clearInterval(timer));
}
function print(text, compact = false) {
echo.set("compact", compact)(recho.inspect(text, {quote: false}));
}
function rand(n = 1) {
return (Math.random() - 0.5) * n;
}