Topic: https://brettterpstra.com/2012/09/15/matrixish-a-bash-script-with-no-practical-application/
hide preview

What's next? verify your email address for reply notifications!

unverified 5y, 294d ago

This is cool and fun. Nice work. Just one thought: In the matrix movies the characters kind of scroll down in columns, not just characters in random positions. What's the chance you could adapt this to do that?

hide preview

What's next? verify your email address for reply notifications!

Adrian 12y, 184d ago

I modified the script to use the 256 color palette supported in the 10.8 terminal (maybe 10.7 too). Not required for most but I've customized my terminal colors to match the Solarized scheme so the basic 16 colors are off.

green="&#092033[38;5;22m"
brightgreen="&#092033[38;5;82m"

hide preview

What's next? verify your email address for reply notifications!

Brett 12y, 185d ago

Thanks guys, I updated the gist with both suggestions (and added you to the credits). Well, not including the explosion of crazy in the second half of Lri's, but… :)

hide preview

What's next? verify your email address for reply notifications!

Lauri Ranta 12y, 185d ago

I'd add tput sgr0 to the trap, so the colors get reset when the script is terminated. Plus...

chars=( $(ruby -KUe 'print ((["1f600".hex].pack("U"))..(["1f6b0".hex].pack("U"))).to_a.join(" ")') )

hide preview

What's next? verify your email address for reply notifications!

Carl 12y, 185d ago

The displays in the movie the Matrix used mirror Japanese katakana. There's no such character as reversed katakana, but if you want slightly more accuracy, you can replace

chars=(a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 ^)

with

chars=(ア イ ウ エ オ カ キ ク ケ コ サ シ ス セ ソ タ チ ツ テ ト ナ ニ ヌ ネ ノ ハ ヒ フ ヘ ホ マ ミ ム メ モ ヤ ユ ヨ ラ リ ル レ ロ ワ ン)
hide preview

What's next? verify your email address for reply notifications!