Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: (Golf) Ordered Combinations

by adolfoams@gmail.com (Initiate)
on Aug 12, 2014 at 13:26 UTC ( [id://1097127] : note . print w/replies, xml ) Need Help??


in reply to Re: (Golf) Ordered Combinations
in thread (Golf) Ordered Combinations

Hi, i am trying following script to create 9 letter combination but not works...waiting for 8 hours but my computer keep no result. but 7 letter is still ok. Can someone help me to solve the issue? #!/usr/bin/perl sub c {my$n=-1+shift;$n?map{my$c=$_;map$c.$_,c($n,@_)}@_:@_}; print join " ", c qw(9 a b c d e f g h i); print "\n";

Replies are listed 'Best First'.
Re^3: (Golf) Ordered Combinations
by AppleFritter (Vicar) on Aug 12, 2014 at 14:04 UTC

    Howdy adolfo, welcome to the Monastery!

    In general, you'll have better luck posting your question as a new top-level post in Seekers of Perl Wisdom. Also, while you're at it, please use <code> tags to format your code; see Writeup Formatting Tips for more.

    Also: the particular solution to the "ordered combinations" problem here is a golfed solution, meaning that the aim was to use as few keystrokes as possible, at the expense of (among other things) readability, time and space complexity. Unless you're specifically interested in Perl golf, you're likely better off using a different solution.