Cartão de Natal Nerd

December 10th, 2004

Category: Cyber World

Muito viagem este cartão de Natal. Faça um copy and paste dele e salve em um arquivo “.pl”. Talvez vc precise acrescentar o shebang
#!/usr/bin/perl
Execute o script, não precisa se preocupar com a bagunça que fica por causa dos espaços. Use as teclas “j” e “k” para movimentar o esquiador.

                                            $x=chr(0x20);sub
                                   P{print@_}$D=qq(/X\);sub
                      S{substr($_[0],$_[1],$_[2])=$_[3]};sub
        i{$n=1;$L++;$X=40-($Y=2);$V=0.01;$S=4}$Z=sqrt(2);sub
         d{$t="X$_[0]X";$t=~s/X/$x/g;map{S($o,$_,15,"*"x15)}
         (822,980);S($o,901,15,"*".$t."*");}$Z=1/$Z;/./;sub
         l{system('stty',($_[0]?"":"-").'cbreak',($_[0]?"-"
         :"").'echo');$_[0]&&P("e[HeJ")}$A=(("$x"x78)."".
         "n")x23;$b=[[[3,3,3,3,0],',,,||'],[[3,3,3,3,0],''
         .'..x//'],[[3,3,0,7,0],q(`====')],[[3,3,0,3,6],"x"
         .'xx\\//``'],[[3,3,0,3,3],q/||||||''/],[[3,3,0,6
         ,3],q,././//'',],[[3,3,0,7,0],'===`=='],[[3,3,3,3,
          0],',,.\\']];$E="LXEXVXEXLX";$y=32767;$z=96;sub
          v{$V*=0.85;$i=$S%4?($S<4?1:-1):0;$j=($S-2)%4?(($S
          -2)%8<4?1:-1):0;$t=$S%1?$Z:1;$V+=$j*($j<0?0.0200:
          0.05-0.01*($S%1));$X+=$i*$t*$V;$Y+=$j*$t*$V};;sub
          o{for$k(0..$_[0]->[0]->[0]-1){for$l(1..$_[0]->[0
          ]->[1]){($_[0]->[2]->[$l-1]&(2**$k))&&$_[1]+$k<=
          77&&$_[1]+$k>=0&&$_[2]+$l-$_[0]->[0]->[1]>=0&&($
           O->[$_[2]+$l-$_[0]->[0]->[1]]->[$_[1]+$k]=1)}}}
           $B="CXRXAXSXHX!";$z=16385;$a=[[[3,4,2,7,7,2],""
           ."X.X$D$D.|",[0,0,2,2]],[[3,2,2,7],'(_)(_)',[0,
           7]],[[6,4,12,30,63,12],"///\////XX\|/____\_"
           .".||",[0,0,12,12]],[[15,06,$y,$y,$y,$z,$z,$z],
           ".".("_"x13).".|XFXIXNXIXSXHX||".("_"x13).q,|,.
           ("|".("X"x13)."|")x3,[0,0,0,0,0,$z]]];/mbm/;sub
            C{($k,$l)=(int($X),int$Y);($k<0||$k>77)&&$c++;
            for$i(0..2){for$j(0..2){($$b[$S][0][2+$j]&(02
	    **$i))&&$l-$j>=00&&$$O[$l+1-$j][$k+$i]&&$c++}
	    }$c&&d($B)};$W="keys_are_j_and_k.q-_quit";sub
             R{$o=$A;$l=($_[1]-4<0)?0:($_[1]+19>@$C)?@$C-
             23:$_[1]-4;for$j(0..$#$C){$$C[$j+$l]||next;;
             for$i(0..$#{$$C[$l+$j]}){$$C[$j+$l][$i]&&r($
             i,$j,$$C[$j+$l][$i])}$j+$l-$_[1]||r($_[0],$j
             ,$b->[$S])}}sub#V{return(int(rand(482)));};;
             r{($g,$h)=@_;$f=$_[2][0][1];while($h>=0&&$f
             >0){$f--;for$e(0..$_[2][0][00]-1){if($h<=22
             &&$e+$g>=0&&$e+$g<=77&&((2**$e)&$_[2][0][2+
             $f])){$t=substr($_[2][1],$f*$_[2][0][0]+$e,
             1);$t=~s/X/$x/g;S($o,79*$h+$e+$g,1,$t)}}--$
             h}}sub#f{$S++;$e=$j+$$b[$S][0];$f=$i+2}sub
              L{l(1);&i;for(;!$d;++$v>999?$v=0:do{/./;(
              select$_=chr(1),"","",0)[0]||next;sysread
              STDIN,$_,1}){$S=($S+(/j/?1:/k/?-1:0))%8;;
              /q/&&($d=1);$n&&p();&v;R(int($X),int$Y);$
              n&&B();&C;P("e[;H$o");$n&&($n--,sleep(2)
              );$c&&($d++,sleep(2));int$Y==@$C&&(i,($L-
              10||$d++),sleep(2))}l()}sub#k{$_[0]+9}sub
              p{$t=int(sqrt($L)*45);$C=[];$O=[];;for$i(0
             ..$t){push(@$C,[]);push(@$O,[])}for$i(0..(40
             *$L)){$$C[U($t)][U(78)]=$$a[U(3)]}$$C[-2][U(20)
            +20]=$$a[3];for$j(0..$t){for$i(0..$#{$$C[$j]}){$$C
            [$j]->[$i]&&o($C->[$j]->[$i],$i,$j);}}}/#######/;sub
            B{d($E.$L)}sub#_{$W=$W.qq.n_-_downhill__racer_-nn.}
            U{int(rand($_[0]))};L()#______________________________##
             #______________________________________________________###
             #_________________________________________________________###
              #_____________D_O_W_N_H_I_L_L___R_A_C_E_R___________________##
               #____________________________________________________________#
                ####__________by__mbm__Christmas_2004________________________#
                    #######__________________________________________________#
                          ###_______Happy_Christmas,_Perlmongers____________##
                             ###__________________________________________##
                                ##_____j_-_clockwise__________________####
                                  ###__k_-_anticlockwise__________####
                                     ########_q_-_quit_____#######
                                             ##############

Fonte: [cam.pm] Christmas again


hlbog

No comments yet


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>