Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-12-20 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls