http://www.perlmonks.org?node_id=1151017

i've been inspired by this code by LanX and mtve (read: i've stolen their golfs as the base..)
to produce something for you all, which intent is clear from BEGIN where the root of every (binary?) tree sleeps...
not a golf but a wish!
# ## ##!/env/perl # # $} ;$| ++; $p;$x; #\*/# foreach $b( split '\+','+0+77+ -8+13+0+7+-57 //\\//\\//\\/ +35+5+10+-9+10+1 +-7+-12+18+-51+ 33 //\\//\\//\\//\\//\\ +13+-10+-36+40+-7+15+0+ 9+-57+46+-9+18+-55+57+-20 //\\//\\//\\//\\//\\//\\//\\ +-4+17+-50+18+-2+1+5+-44+22+0+0+ 52+-5+-47+57+-10+6+-53+33+11+0+-44 //\\//\\//\\//\\//\\//\\//\\//\\//\\ +48+-11+13+-6+1+2+-1+-3+8+-51+38+12+-3+ -2+-45+36+5+10+-16+6+7+5+-9+9+-2+-51+0+10 //\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\ +-32+0'){system$};eval 'printf qq(%22s%s\n), $_ %=21,$_=4**$_,y/0/^/c,s/0/$b<0?o:O/eeee for 1..23'; print $y.= chr($x += $p);$p = $b; sleep 1 } print chr( $x += $p ) ; # BEGIN{$}=$^O eq'Linux'?'clear':'cls';$^W=0} BEGIN{$}=$^O eq'MSWin32'?'cls':'clear';$^W=0}
Justin Case there is gift under the tree..

L*
update: changed the BEGIN block to be more inclusive..

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re: Not a golf but a wish..
by Tux (Abbot) on Dec 23, 2015 at 12:35 UTC

    Only care about Linux and Win32? Solaris, HP-UX, AIX and other Unix flavors all use clear, not cls. As a HP-UX user I hate being put in the Win32 camp!

    In the code shown, it will always use cls, as the value for $^O on Linux is linux, not Linux.

    I also test my modules on Win32, so I am not a hater of win32, but having been confronted with tests like this in the past, you'd break more than you fix.

    /me counts down to the official perl6 release. Almost X-mas ! :)


    Enjoy, Have FUN! H.Merijn
      the original BEGIN block restored!

      L*


      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
        Nice tree :)