Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Friday Golf: All 2-digit combinations

by hardburn (Abbot)
on Sep 26, 2003 at 14:18 UTC ( #294431=note: print w/ replies, xml ) Need Help??


in reply to Friday Golf: All 2-digit combinations

Since most solutions have the numbers running together, I wrote up this little one-liner to help split the pairs apart:

perl -ne 'print join " ", sort unpack("A2" x (length()/2), $_)'

Just pipe the output of your Golf solution into it.

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

Note: All code is untested, unless otherwise stated


Comment on Re: Friday Golf: All 2-digit combinations
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2015-09-01 05:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (367 votes), past polls