Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Golf: Embedded In Order

by turnstep (Parson)
on Apr 27, 2001 at 19:21 UTC ( #76141=note: print w/ replies, xml ) Need Help??


in reply to Golf: Embedded In Order

This was fun. :)

82 with extra credit, does it in a clever way

#!/usr/bin/perl use strict; my $t = shift || "gttb"; my $s = shift || "gattacababy"; my $return = &PopPopChopChop($s,$t); print "Original: $s\n"; $return = "UNDEF" unless defined $return; print "Returned: $return\n"; exit; sub PopPopChopChop { $a=reverse pop;$_=pop;$b=chop$a; s!(.)!$b and$1=~/$b/and$b=chop$a;$1!eg;$b?undef:$_ }


Comment on Re: Golf: Embedded In Order
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-08-20 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (105 votes), past polls