Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

A challenge

by athomason (Curate)
on May 18, 2000 at 11:15 UTC ( [id://12299]=obfuscated: print w/replies, xml ) Need Help??

#!/usr/local/bin/perl $p='cca 0.ToYnCt`H=h5s\ 1 |.4e]J>a9ndr6t::<wXiZ SbK#L NfO Psqnr\'Rmstt + ubvext'. 'y z1!J"u#s$t,g.:)d/)*i2Q3uUlVsW {7[a7i8o; Gmi k ^A_PmonubspdIneifp?t@ +\'AsB J'. ' DhEegt- \'iF QyoljI+nHih?Mo(d&kwa% lc';for(0..length($p)-1){push@r,( +substr$p, $_,1)};$h{ord(pop@r)-33}=pop@r while(scalar@r>0);print map($h{$_},sort +{$a<=>$b} keys%h);

Replies are listed 'Best First'.
RE: A challenge
by Anonymous Monk on May 30, 2000 at 21:47 UTC
    From the command line:
    echo Just another Perl Hacker | perl -pe lc
    
    16 unique Characters. Assuming (from one of your later posts, that this is your general algorithm:
    my $string = q{echo Just another Perl Hacker | perl -pe lc};
    
    $string =~ s/\s+//g;
    
    $string = lc $string;
    
    my %chars;
    
    map { $chars{$_} = '' } split //, $string;
    
    print scalar keys %chars;
    
    
    What do I win? ;-)
RE: A challenge
by rjimlad (Acolyte) on May 25, 2000 at 21:32 UTC
    Very impressive... of course by the time I've read as far as the map statement, I've completely lost track of what $_ is/would be... brain fused... ---- Arrr, Jim lad.
RE: A challenge
by turnstep (Parson) on May 18, 2000 at 19:57 UTC
    I don't think that there is any set rule about that...
      I suppose I should've made it longer to be clear, but I only had 96 characters in the string before ASCII funky chars showed up. Anyhow, I was wondering just whether it could be done *at all* with fewer symbols than the trivial
      print 'just another perl hacker';
      which uses 17 unique characters.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://12299]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-03-28 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found