This 3-function library simply calculates permutations and combinations for a certain number and given times with or without repetitions. These are useful statistical utilities and can be used in a lot of applications, e.g. counting the number of matches played in a 16-team tournament or the number of combinations for a 4-digit lock or password from 10 possible numbers(0-9)..It also includes a factorial function, e.g. 3!.
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim pclib As Permcomb
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Log(pclib.comb (10,2,False)
End Sub
.
.