Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Compression in Golf: Part I

by eyepopslikeamosquito (Canon)
on Sep 23, 2012 at 08:50 UTC ( #995190=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Input       |        C        |        a        |        t
    ord         |       67        |       97        |       116
    ...
    6-bit chars |     16     |      54     |      5      |     52
    +32 -> ord  |     48     |      86     |     37      |     84
    Output      |      0     |       V     |      %      |      T
    
  2. or download this
    $ perl -e 'print pack("u","Cat")'
    #0V%T
    ...
    M0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T
    M0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T0V%T
    $0V%T0P``
    
  3. or download this
    # Marko
    $_=pack+u,'packed-source-string';y/1-Z/7 ^A9-@5Fa-}/;eval
    # Sec
    ($_=pack u,q{packed-source-string})=~y/'A-Z`/ a{-}e-i\n\t1 n-yFm/;eval
    
  4. or download this
    eval lc pack u,'packed-source-string'
    
  5. or download this
    eval lc pack u,''                          [17]
    s//lc pack u,''/ee                         [18]
    ...
    s//lc pack(u,'')x99/ee;y/v_/ N/;print      [37]
    s//lc pack u,''x99/ee;y/[-^/ NGT/;print    [39]
    s//lc pack(u,'')x99/ee;y/[-^/ NGT/;print   [40]
    
  6. or download this
    eval lc pack u,'packed-source-string'
    
  7. or download this
    $c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($_^$`%12?o:x)&($_^$'/5?o:'}')for<>
    +!~/:/..11;print"@$_
    "for@c
    
  8. or download this
    $c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($_^$`%12?o:x)&($_^$'/5?o:v125)for<
    +>!~/:/..11;print"@$_\n"for@c
    
  9. or download this
    mx;$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($_^$`%12?o:x)&($_^$'/5?o:v125)f
    +or<>!~/:/..11;print"@$_\n"for@c
    
  10. or download this
    map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($_^$`%12?o:x)&($_^$'/5?o:v125),
    +<>!~/:/..11;print"@$_\n"for@c
    
  11. or download this
    map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($_^$`%12?o:x)&($_^$'/5?o:v125),
    +($_=<>,!/:/)..11;print"@$_\n"for@c
    
  12. or download this
    map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($_^$`%12?o:x)&($_^$'/5?o:v125),
    +0..s//<>/e./:/;print"@$_\n"for@c
    
  13. or download this
    map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($`%12^$_?o:x)&($_^$'/5?o:v125),
    +0..s//<>/e./:/;print"@$_\n"for@c
    
  14. or download this
    #        1         2         3         4         5         6
    #234567890123456789012345678901234567890123456789012345678901
    map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($`%12^$_?o:x)&($'/+5^$
    a.$_?o:v125),0..s//<>/e./:/;print"@$_\n"for@c
    
  15. or download this
    my $source = <<'PERSEVEROUS';
    map$c[$_*=.52,5.5-4.7*cos][8+7.4*sin]=($`%12^$_?o:x)&($'/+5^$
    ...
    PERSEVEROUS
    my $out = unpack 'u',uc($source);
    print "eval lc pack u,'" . $out . "'";
    
  16. or download this
    @c=(@b=(++$n,bottle.'s'x@-,of,beer),on,the,wall),s//Take one down and 
    +pass it around, @c.
    
    @c, @b.
    /until/, 99\D+/;print$'."Go to the store and buy some more$&"
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://995190]
Approved by Old_Gray_Bear
Front-paged by davies
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (14)
As of 2014-11-26 15:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (171 votes), past polls