in reply to Re^2: Unique Combos with Math::Combinatorics
in thread Unique Combos with Math::Combinatorics

Why did you remove the loops in favour of all that typing and redundancy?

And [ @n ] needlessly creates a copy of the array when you could simply use \@n.

Replies are listed 'Best First'.
Re^4: Unique Combos with Math::Combinatorics
by ketema (Scribe) on Mar 02, 2008 at 03:41 UTC
    Simply because although I understood the idea of what you were doing, I did not understand how to use the code. I typed it out so i could visualize what was going on,each assignment etc... After reviewing your code and comparing I do see now how it works, but I never would see that on my own to start. Thanks for the help.

      I did not understand how to use the code.

      Change
      for each combination @c:
      to
      while ( my @c = $comboObj->next_combination){

      and change
      # emit combination here
      to
      print join(', ', @c) . "\n";

      After reviewing your code and comparing I do see now how it works,

      It was neither my code nor my post.