Not sure of my fascination with this, but liverpole's Spatial Japh got me interested in animated ascii graphics. That, along with greats such as How to (ab)use map and How to (ab)use substr and my own contribution to the (ab)use series (Ab)using fo(u)r...... all inspired me to abuse 'or':
#!/usr/bin/perl
$oar=3;$nor=0;$xOr=0;use Time::HiRes qw(usleep
);$oAr=5;sub or{for my$xor(0 ..9){for my$or(0..65){$
oar[$xor][$or]=' '}}}%or=(aor=>2 ,bor=>4,cor=>3,dor=>4,eor
=>6,gor=>7 ,hor =>6, jor=>8 ,lor=>
27,mor=> 30, nor => 61, oor =>
63,por=> 64 ,qor =>65); while(
1){ for$ OR(a..d ){if(( $OR eq
'b')or($ OR eq'c' )){$or {aor}++
;$or{cor }++;$or{ dor}++; $or{eor}
--;$ or{ gor}--;$ or{jor} --;}else
{$or{aor }--;$or{ cor}--; $or{dor}
--;$ or{ eor}++;$ or{gor}++;$ or{jor}++;}&
or;for([ $or{aor} ,$or{bor}],[$or{aor},$or{
lor}],[$ or{bor}, $or{mor}],[$ or{bor},
$or{nor} ],[$ or{ cor},$or{ oor}],[
$or{cor} ,$or{por }],[$or{ dor},$
or{qor}] ,[$ or { eor},$or {qor}]
,[$ or { gor } ,$ or{por}] ,[$or{
gor},$or {oor}],[ $or{hor} ,$ or {
nor}],[ $ or{hor},$ or{mor}] ,[$ or{
jor},$ or{ lor}],[$or {jor },$ or{bor}],
[$or{hor},1 ],[$or{bor} ,1],[$or{ aor},$ or{
bor}]){nor($ _->[0],$_->[ 1])}oar ($ OR);usleep(
300000);}}sub ore{$OR=shift ;$oar=3;if( $OR eq'a'){$
oR=sub{uc shift}}if($OR eq'b'){$oR= sub{shift}} if($OR eq'c'
){$ oR=sub{'-'}}if($ OR eq'd'){$oR= sub{shift}} $yor=',rekc'
.'ah '.'lraoP '.'rehtona tsuJ';@ or =split//,~~ reverse$yor;
for($oar..((length$yor)+$ oar-1)){$ oar[$oAr][$ oar++]=&{$oR
}(shift@or)}}sub nor{($xor,$or)=@_; if(($xOr!=0 )&&($nor!=0)
){while(($xOr!=$or)or($nor!=$xor)){ if($xOr<$or ){$xOr++}if(
$nor<$xor){$nor++}if($xOr>$or){$xOr --}if($nor> $xor){$nor--
}$oar[$nor][$xOr]='*'}}$xOr=$or;$ nor=$ xor } sub oar{ore(
shift);$ore=0;print"\e[2J\e[H\n" ;for(@oar){ for(@{$oar[$
ore]}){print"$oar[$ore][$orr]" ;$orr++ } $ ore++;$orr=0
; # do not { or not # nor # { # oar # } # ore # { # or # oar # or } #
; ; $# or $# ; print "\n" } }# or # or # ore # nor # or # oar # or #
; # or { # } } # { # xor # nor # or # oar # } orr # ore # xor # nor #
It might not work on windows, but I can't test there anyhow.
And in case you can't tell, it's sort of supposed to be rotating :)
Enjoy!
--chargrill
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ }
+ sig
map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu
+" );
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.