#!/usr/bin/env fish # 20260428 (>)32 iterations in, Digit got (mistral &) claude to make: # a rudimentary matrix cascade in fish, that may have some utility # (you can pipe files into it!) set -l lines (cat $argv) set -l num_lines (count $lines) set -l cols (tput cols) # shuffled column positions, cycling for files longer than screen width set -l col_positions (seq 1 $cols | awk 'BEGIN{srand()} {print rand(), $0}' | sort -n | awk '{print $2}') # find longest line set -l longest 0 for i in (seq 1 $num_lines) set -l l (string length -- $lines[$i]) if test $l -gt $longest; set longest $l; end end set -l active 0 set -l row 0 set -l total_rows (math $longest + $num_lines) while test $row -lt $total_rows set row (math $row + 1) if test $active -lt $num_lines set active (math $active + 1) end set -l row_chars for i in (seq 1 $cols) set -a row_chars " " end for i in (seq 1 $active) # stagger: column i starts printing at row i, so char index is row - i + 1 set -l char_idx (math $row - $i + 1) if test $char_idx -lt 1; continue; end set -l ch (string sub -s $char_idx -l 1 -- $lines[$i]) if test -n "$ch" # cycle col_positions for files with more lines than cols set -l slot (math "($i - 1) % $cols + 1") set row_chars[$col_positions[$slot]] $ch end end printf "%s\n" (string join "" $row_chars) | lolcat --force sleep 0.05 end