Here's another animated JAPH for your enjoyment!
This one optionally takes a number as an argument; save it to a file and run it with perl rotate.pl 13, for example.
The same caveats apply as for Swap JAPH; it's not expected to work on all platforms, and I concentrated on making it as compact as possible rather than as obfuscated as possible. (Although the latter does follow somewhat from the former, of course. :)
($s=pop|1)>8or$s|=8;sub f{$_=.5+($h=int$s/2)+$h*$_}$|=@m=map[($")x$s
+],1..$s
;$j=' ,rekcah lreP rehtona tsuJ ';for(0..31){f,$_-=/-/for$x=co
+s($d=$
_*.19635),$y=sin$d;$m[$y[$_]=$y][$x[$_]=$x]=chop$j}{$j=$m[$y[0]][$
+x[0]]
;print"\e[H\e[J",map"@$_\n",@m;map$m[$y[$_-1]][$x[$_-1]]=$m[$y[$_
+]][$
x[$_]],1..31;$m[$y[-1]][$x[-1]]=$j;select$,,$,,$,,.1;redo}chipmu
+nk;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.