Re: Get all combinations of n digits among m digits
- Posted by petelomax 1 week ago
- 140 views
jmduro said...
Damned, there was still an error
LOL. I wonder if what you're actually missing is this:
function combinations(sequence s, integer lg) combis = {} if lg<=length(s) then recurse(s, lg) end if return combis end function
and then there should be no need to ever test nr=1.
Plus of course potentially skipping a whole pile of completely pointless effort.
PS: lg=0 currently returns {{}}, which I think is correct. There are probably pros and cons to making it return {} instead,

