Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: perl puzzle - cartoon couple registry (TMTOWTDI)

by jynx (Priest)
on Jun 13, 2002 at 01:32 UTC ( #174092=note: print w/replies, xml ) Need Help??


in reply to perl puzzle - cartoon couple registry (beginner, semi-golf)


Since i can't think of a good way to golf this well, i'll bend the rules slightly. Here's a solution that you place before the couples declaration. It uses command line options, two quotes, and weighs in at 58 chars. Slightly amusing...
#!/usr/bin/perl -l #23456789_123456789_123456789_123456789_123456789_123456789_ sub _{print shift()." is married to ".shift while@_}_ sort %couples = ( Fred=>"Wilma", Barney=>"Betty", George=>"Jane", Homer=>"Marge", Peter=>"Lois" );
jynx

Update: Ah, err, uh, whoops... LOL! This is a non-working solution. It's really amusing who's married to whom in it though! Sorry about that, apparently my eyesight is going (i thought it looked fine until i retested a couple minutes ago) -- it must be time to go home...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://174092]
help
Chatterbox?
[LanX]: hmm   Chatterbox FAQ doesn't talk about breaking up long words
[marto]: breakin' up is hard to do
[LanX]: 123456789012345678 90 123456789012345678 901234567890
LanX should break up with false friends ;)
[Discipulus]: last hour of cb breaks it differently..
[LanX]: I think I've send one whitespace by myself at 20

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (11)
As of 2017-07-24 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (350 votes). Check out past polls.