Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: (Golf) Per Mutations

by MeowChow (Vicar)
on May 04, 2001 at 02:25 UTC ( #77821=note: print w/ replies, xml ) Need Help??


in reply to Re: (Golf) Per Mutations
in thread (Golf) Per Mutations

Perhaps you'll be able to knock off a few more chars, since the sub isn't supposed to print anything - it only needs to return the data structure specified in the problem description.

A brief reduction of this sub gives 79 chars though:

sub t{!@_&&print@r,"\n";for my$i(1..@_){push@r,$_[$i-1];t(@_[0..$i-2,$ +i..$#_]);pop@r}}
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on Re: Re: (Golf) Per Mutations
Download Code
Re: Re: Re: (Golf) Per Mutations
by arhuman (Vicar) on May 04, 2001 at 02:36 UTC
    Well done !
    But you should know that I leave a space between my and $i to get rid of a:
    'Missing $ on loop variable' error message with my Perl(5.0 patchlevel 5 subversion 3 on linux)

    "Only Bad Coders Badly Code In Perl" (OBC2IP)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-08-21 02:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (127 votes), past polls