Permutations with repetitions: Difference between revisions

Permutations with repetitions en FreeBASIC
(Added Quackery.)
(Permutations with repetitions en FreeBASIC)
Line 739:
permute(_,0) -> [[]];
permute(L,I) -> [[X|Y] || X<-L, Y<-permute(L,I-1)].</lang>
 
 
=={{header|FreeBASIC}}==
<lang freebasic>
Dim As String list1(1 To 2, 1 To 3) = {{"a", "b", "c"}, {"a", "b", "c"}}
Dim As String list2(1 To 2, 1 To 3) = {{"1", "2", "3"}, {"1", "2", "3"}}
 
Sub permutation(list1() As String)
Dim As Integer n, m
For n = 1 To Ubound(list1,1)
For m = 1 To Ubound(list1,2)
Print list1(1, n); " "; list1(2, m)
Next m
Next n
Print
End Sub
 
permutation(list1())
permutation(list2())
Sleep
</lang>
 
 
=={{header|Go}}==
2,130

edits