| Difference (author diff) |
|
<toc> |
<pre> |
#!/usr/bin/perl |
$_=' |
$q ="\ 47"; wh |
ile ($ ;= |
$z += .5 ){ |
%c= $r=0;$/ ="";whi le(2 |
0+ $z>($;+=.05)){$c{int$ _+ 2 |
6+ 2*($ r+= .0 2) * |
s in$ ;}{1 -$_ |
+1 0+ int $r*c o s |
$ ;} =1for(0. .1) }$ |
t =r ever se;$ /. =` |
c le ar `. " #! |
/ usr /bi n/ pe |
rl \n\ $_ =$q \n" ; |
fo r$y (1..20){$c{$_} { |
$ y }? $ /.=chop$t : |
($/ . =" \4 |
0") for(0. .53) ; |
$/. ="\n"}pri nt"$/$ q; |
s; ". chr(9 2)."s;;g;eval\n "} |
';s;\s;;g;eval |
</pre> |
<pre> |
#!/usr/bin/perl |
$r=25; $c=80; |
$xr=6;$yr=3;$xc=-0.5;$dw=$z=-4/ |
100;local$";while($q=$dr=rand() |
/7){$w+=$dw;$_=join$/,map{$Y=$_* |
$yr/$r; |
join"" ,map{$ x=$_*$ |
xr/$c;($ x,$y)= ($xc+$x |
*cos($ w)-$Y* sin$w,$yc+ |
$x*sin ($w)+$Y*cos |
$w);$ e=-1;$ a=$b=0 |
;($a,$b) =($u-$v+$x,2*$a* $b+$y) while( |
$ u=$a*$ a)+($v=$b*$b)<4.5 &&++$e <15;if (($e>$ |
q&&$e< 15)||($e==$q and rand() <$dr)) {$q=$e;($d0,$d1) =($x,$ |
y); } chr(+( 32,96,+ 46,45,43,58,73,37 ,36,64 |
,32)[$ e/1.5] );}(-$ c/2)..($c/2)-1;} (-$r/2 |
)..($ r/2)-1;select$", $",$", 0.015; system |
$^O=~m ~[wW]in~x?"cls": "clear";print ;$xc=( |
$d0+15 *$xc)/16;$yc=($ d1+15*$yc)/ 16;$_*= |
1+$z for $xr,$yr;$dw *=-1 if rand |
()<0.02; (++$i%110 )||($z*=-1)} |
</pre> |
<pre> |
#!/usr/bin/perl |
+ |
@A= |
(25,0 |
);@B=(0 |
,24 +0) |
;@C=( 49,24 |
);@X=($")x(40 |
+9) ;@_ |
=(@X, $/)x( |
25);$_[ $A[1*1] |
*50 +$A [0] ]=q |
/./;+ $_[$B [1*1] *1*50 |
+$B[0]]=qq/./;$_[$C[1]*50 |
+$C [0] |
]="." ;@X=( |
$C[0*0] ,$C [1] |
);1 *1* 1*1 *1; |
while (394> (join $",@_ |
)=~y/.//){do{ $R=3*rand;@X= |
((( int (($ {(A |
,B,C) [$R]} [0*0] +$X[0 |
])/2+.5 )),int( (${(A,B ,C)[$R] |
}[1 *1] +$X [1] )/2 +.5 +0) ))} |
while $_[$Z =$X[1 ]*50+ $X[0] +0]=~ /\./; $_[$Z |
]=".";+system$^O=~/[wW]in/?"cls":"clear";print@_} |
</pre> |
<pre> |
#!/usr/bin/perl -- -*- cperl -*- |
my%t=('H'=>[99,6,0,3,4,0,1],'*'=>[5,3,1,2,1,2,11],'O'=>[7,9,0,4,8,3,4] |
,'x'=>[12,3,0,1,9,2,4],'+'=>[17,3,0,1,9,2,4],);sub _{my($x,$y,$t)=@_;$ |
g[$x][$y]=l($t,$x,$y)}sub l{my($t,$x,$y,$a)=@_;+{v=>$t,i=>sub{++$a;my( |
$n,$s,$o);my@t=@{$t{$t}};for$u(-1..1){for$z(-1..1){$n=$g[$x+$u][$y+$z] |
;if($n->{v}eq$t){++$s}elsif($n->{v}){++$o}}}if($s<$t[2]or$s>$t[1]or$o> |
$t[4]or$o+$s<$t[5]or$a>$t[0]){undef$g[$x][$y]}if(rand(10)<$t[6]or$s==$ |
t[3]){my($v,$w)=map{rand(42)%3-1}0..1;$v+=$x;$w+=$y;$g[$v][$w]=l($t,$v |
,$w)if not$g[$v][$w];}}}}map{_($$_[0],$$_[1],"H")}([20,10],[20,9],[21, |
10],[21,9]);_(40,10,'*');_(39,10,'*');map{my$q=$_;map{_($_,$q,'O')}(29 |
,30)}(18,19);_(30,3,"+")^_(29,3,"x");while($:){&c;for$y(1..22){for$x(1 |
..60){if($m=$g[$x][$y]){print$$m{v};$$m{i}->()}else{print" "}}print$/} |
print$/;sleep 1}sub c{`clear`}#To support Win32 make that sub c{`cls`} |
</pre> |
<pre> |
#!/usr/bin/perl |
$_=q`$_=' |
@8GCI';@a=/./g; |
$j=9;$k=9;$w=25;$ c=35;$e= |
8;$u=2;$v=1;{$k+=$v* =$k<6|$k>16?-1: |
1;$j+=$u*=$j<9|$j>60?- 1:1;my(%l,$m,$n); |
for$y(0..22){for(0..70 ){$r=($_-$j)/1.6;$s= |
$y-$k;$d=(($_-$c)**2+( $y-$f)**2+(($w-$r**2-$ |
s**2)**.5-$e)**2)**.5; if($r**2+$s**2<$w){$m= |
$d<$m||!$m?$d:$m;$n= $d>$n?$d:$m;$l{$y}{$_} |
=$d;}}}print"\ec"; for$y(0..22){print$_>6 |
9?$/:(($d=$l{$y }{$_})?$a[($d-$m)*5/ |
$n]:$")fo r(0..70)}select$q, |
$q,$q,.1;redo}`; |
s#\s##g;eval |
</pre> |
<pre> |
#!/usr/bin/perl |
$@='Just Another Perl Hacker';$@=length($@); |
$|=abs(2-$@);goto f;z:if(int(rand(10))>5){($- |
,$.)=($",$;);}else{($-,$.)=($",$;);}@b =();$b |
[0] = $-;if($- ==$;){$b[1]=1;}else{$b[1]=7 + |
50 + 10 + (5 * 2);}$,='l';$,='r'if$-==$";$vd |
='u';$vd='d'if int(rand(10))<5;while($|){my |
$s="";foreach $%(0 .. 22){foreach$=(0 .. 78) |
{if($===39){$s.="|";}if($%==$;&& $===0){$s.= |
"]";}elsif($===$b[1]&& $%==$b[0]){$s.= "*";} |
elsif($===78&& $%==$"){$s.="[\n";}elsif($=== |
78){$s.=" \n";}else{$s.=" ";}}}print $s;#### |
$b[1]==1 and$,='r';$b[1]==77 and$,='l';$b[0] |
== 23 and$vd='u';$b[0]==0 and$vd='d';if($,eq |
'r'){$b[1]++;$mp=\$";}if($, eq'l'){$b[1]--;# |
$mp=\$;;}if($vd eq'u'){$b[0]--;$$mp-- unless |
$$mp==0;}if($vd eq'd'){$b[0]++;$$mp++ unless |
$$mp == 22;}select $`,$`,$`,.05;system($^);} |
f:$^='clear';$"=int(rand(22));$;=int(rand(22 |
));$^='cls'if$^O=~m|win|i;goto z;########### |
</pre> |
<pre> |
#!/usr/bin/perl |
################################################################ |
#################### Digital Clock v1.0 ######################## |
################################################################ |
$m[0]='521122211132111132115111421142521132111142';$m[1]='15311' |
.'5211521133114133'.'114153115134113414113153115133115';;;$m[2]= |
'15311521152131131131121315321515421542311311153215143215';$m[3] |
='153115'. '2115212'# |
.'113214'. ''. ''. '1144115'# |
.'411515'. ''. ''. '3115211'# |
.'321153'. '11'.'54'# |
.'115';//; ;;;;$m[4]= |
'153215221522111332143213411542131432131113311532154115';//;;$r= |
q$ _/\|$;$s=5;for($k=0;$k<$s;$k++){$x=length($m[$k]);for($i=0;$i |
<$x;$i=$i+2){$n=substr($m[$k],$i,1);$c=substr($m[$k],$i+1,1);$~[ |
$k].=substr($r,$c-1,1)x$n;}}do{$_=localtime(time); |
/.*(\d)(\d):(\d)(\d):(\d)(\d).*/;for($i=0;$i<5;$i++){print"\ec", |
,qq$\075$x45,qq{\012}if($i==0);print"\174\040",substr($~[$i],$1* |
5,5),"\040",substr($~[$i],$2*5,5),(($i==2)?"\157\040":"\040"x2), |
(($i==3)?"\157\040":"\040"x2),substr($~[$i],$3*5,5),"\040", |
substr($~[$i],$4*5,5),,(($i==2)?"\157\040":"\040"x2),,(($i==3)? |
"\157\040":qq{\040}x2),(substr($~[$i],$5*5,5)),qq{\040},substr( |
$~[$i],$6*5,5),"\040\174","\012";print"\174\040" |
,"\040"x41,"\040\174","\012","\075"x45,qq{\012} |
if($i==4);}}while(sleep(1.5)); |
</pre> |