En op 28 februari 2002 sprak /-\ndrew:
> k.pl (82 characters):
> open 0;chop,$==length,$=<$-or$-=$=for@a=<0>;
> print map{$"x($--length).reverse.$/}@a

I just whittled k.pl to 79:
open$[;chop,($==y===c)>$-&&($-=$=)for@:=<0>;
print$"x-(y---c-$-).reverse.$/for@:

Apart from reducing the stroke count, it is vital to
minimize alphanumeric characters, since non-alphanumerics
do not require sightly encoding.

For cheap thrills, I also improved kk.pl/pp.pl and wrote
a new m.pl:

kk.pl (34 characters):
open$%;chop,print+reverse.$/for<0>

pp.pl:
chop,$==y===c,$=<$-or$-=$=for@a=<>;
print$_.($"x($--length)).$/for@a

m.pl (63 characters):
$:=pop||'';open$[;print+map$:eq'mirror'?chop&&reverse.$/:$_,<0>

producing a new and improved Buffy looking in the mirror.
This new version, shown below, takes an optional first argument of
'mirror', so you can see Buffy the right way around (by default) or
looking in the mirror (by giving a first argument of 'mirror'):

cd Acme-EyeDrops-1.06/demo
perl sightly.pl -r -f m.pl -s buffy2 >b.pl
perl pp.pl b.pl >buffy.pl
cat buffy.pl           (should show Buffy's face)
perl buffy.pl          (should show Buffy's face again)
perl buffy.pl mirror   (should show Buffy looking in the mirror)

/-\ndrew

                   ''=~('('.'?'                                
                .'{'.('`'|"\%").(                              
              '['^'-').('`'|'!').(                             
             '`'               | ','                           
            ).+                (  '"'                          
           ).+                 (   (((                         
          (((                  (   (((                         
         (((                  (     (((                        
        (((              '\\'))      )))                       
        )))          ))))      )     )))                       
       )))       )).+           (     '$'                      
       ).+     ((                (     ':'                     
       )))    .                   (    '='                     
       ).(   (                     ('['))^                     
      '+'    )                      . (  (                     
      (   '`') )|'/')      .('['^     (  (                     
      (  (  ((                        (  (                     
      (  (      ( (( (     ( (( (     (   (                    
      (  (       '+')       ))))      )   )                    
      )   )                        )))    )                    
      )    )))                     )      )                    
      ))      )       )   .        (     ((                    
      '|'      )        )          )    .((                    
       '|'))."'"                   ."'".';'                    
       .('`'|'/'    ).(('[')^     ('+')).(                     
       '`'|'%').(     "\`"|     ( ('.'))).                     
       '\\'.'$'.'['            .  (';').(                      
       '['^'+').('['          ^   "\)").(                      
       '`'|')').('`' |      (     '.')).(                      
       '['^'/').'+'.     (        ('`')| (                     
       '-')).("\`"|              "\!").(   (                   
       '[')^('+')).              ('\\').     (                 
        '$')."\:".(             '`'|'%')     .("\["^           
        '*')."\'".(             '`'|'-'      )      .("\`"|    
  ')').('['^')').(            ( "\[")^       (             (   
 (    ( ')'))))).( (        (   '`'))        |              (  
(     ( "\/")))).(   (   (     '['))         ^              (  
(     ')')))."'".       (     '?')           .              (  
(    '`')|'#').(        (                    (               ( 
(     '`'))))|          (                    (               ( 
(     ( '(')                                 )               ) 
)     )                                      )               . 
(     (                                      (               ( 
(     (                                      (      (         (
(     (                                      (      (         (
(     (                                      (     (          (
(     (                                      (     (          (
(     '`'))))))))))))))))))))))))|'/').(('[')^    (           (
(    '+')))).'&'.'&'.('['^')').('`'|'%').('['^'-')            .
(    '`'|'%').('['^')').('['^'(').('`'|'%').'.'.''.           (
(   '\\')).'$'.'/'.':'.'\\'.'$'.'_'.','.'<'.(('^')^(          (
(   '`'))|'.')).'>'.('!'^'+').'"'.'}'.')');$:='.'^'~'         ;

Reply via email to