The ZMatrix has you

Some fun for your terminal!

Launch the following ./zmatrix script (after doing a chmod +x ./zmatrix) to be part of the ZMatrix :sunglasses:

Demo:

https://cl.ly/1X0Y0m080o05

Code:

#!/bin/zsh
#based on http://codegolf.stackexchange.com/a/17337
COL=$(tput cols)
ROW=$(tput lines)
GREEN=`tput setaf 7`
WHITE=`tput setaf 2`
cleanup() {
  printf '\033[2J\033[1;1H\033[?25h\033[0;0m' && tput sgr0 && tput cnorm
}
drop() {
  for ((r=1; r<$2+$3+1; r++)); do
    R=$RANDOM
    CHAR=`printf %04X $((377+R%6))`
    [ $r -lt $2 ] && echo "\033[$r;$1H$GREEN\u$(printf %04X $((377+RANDOM%6)))"
    [ $r -le $2 ] && echo "\033[$[r-1];$1H$WHITE\u$(printf %04X $((377+RANDOM%6)))"
    [ $r -gt $3 ] && echo "\033[$[r-$3];$1H "
    sleep .1
  done
}
trap cleanup EXIT
printf '\033[2J\033[?25l' && tput bold
while sleep .1; do
  drop $[RANDOM % $[COL-1] + 1] $[RANDOM % $[2*ROW/3] + ROW/3] $[RANDOM % 20 + 5] &
done
2 Likes

its goood :slight_smile: i like that.