Hacker News new | ask | show | jobs
by wutwutwat 623 days ago
alias snow='for((I=0;J=--I;))do clear;for((D=LINES;S=++J*3%COLUMNS,--D;))do printf %*s.\\n $S;done;sleep .1;done'
1 comments

zsh: parse error near `)'
Need a space after each `for` keyword.

A while back there was a whole post about making it snow in your terminal [1]. I think my favorite was [2]:

    while sleep 0.1; do printf "%-$(( ( RANDOM % `tput cols` ) - 1))s\e[0;$(( 30 + ($RANDOM % 8) ))m*\n" ; done
[1] https://news.ycombinator.com/item?id=38652339

[2] https://news.ycombinator.com/item?id=38654884

alias snow='for ((I=0;J=--I;)); do clear; for ((D=LINES;S=++J*3%COLUMNS,--D;)); do printf %*s.\\n $S;done;sleep .1;done'