Permutations: Difference between revisions

Line 5,691:
This follows the Go language non-recursive example, but is not limited to integers, or even to numbers.
 
<syntaxhighlight lang="langur">val .factorial = fn( .x) {: if(.x < 2: 1; .x * self(.x - 1)) }
 
val .permute = fn(.list) {
Line 5,697:
 
val .limit = 10
if len(.list) > .limit: throw $"permutation limit exceeded (currently \{{.limit;}})"
 
var .elements = .list
990

edits