Skip to content

Instantly share code, notes, and snippets.

@hirakun
Created December 17, 2014 04:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hirakun/a100fca2e0ea1e5f7a6d to your computer and use it in GitHub Desktop.
Save hirakun/a100fca2e0ea1e5f7a6d to your computer and use it in GitHub Desktop.
Snow 2014 - Make your terminal snow with Perl
perl -e 'binmode STDOUT, 'utf8';use Time::HiRes "sleep";$| = 1;$m="\x{2603}";($y,$x)=split(/ /,`stty size`);print "\033[2J";while(1){push @snows,{y=>1,x=>int(rand($x))};for(@snows){print "\e[".($_->{y}-1).";$_->{x}H \e[$_->{y};$_->{x}H$m\e[1;1H";$_->{y}++;shift(@snows) if $_->{y} > $y}sleep(0.1);}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment