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

Re^3: ACA JAPH

by chargrill (Parson)
on Aug 18, 2007 at 17:42 UTC ( #633504=note: print w/ replies, xml ) Need Help??


in reply to Re^2: ACA JAPH
in thread ACA JAPH

<shameless plug>
There's a number of tips and techniques listed in Perl Golf 101 as well as in the comments to that node.
</shameless plug>


--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)


Comment on Re^3: ACA JAPH
Select or Download Code
Re^4: ACA JAPH
by eyepopslikeamosquito (Canon) on Aug 18, 2007 at 23:09 UTC

    Wow, that's a nice node that I wasn't previously aware of. The basic shortenings I made were:

    • all variable names one char in length
    • eliminate variables where you can
    • removed quotes from strings (e.g. "FRED" -> FRED)
    • $x=1;$y=1 -> $x=$y=1
    • shift -> pop in subs
    • removed return in subs
    • split // -> /./g
    • for {...} -> ... for
    • if {...} -> ... or ...
    • ' ' -> $"
    These all seem to be mentioned in Perl Golf 101, except perhaps the last one. BTW, I've added Perl Golf 101 to the list of references in The Lighter Side of Perl Culture (Part IV): Golf.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://633504]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2014-08-23 04:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls