Here is a handier variation that translates a number permutation into a Values string setup in a ValuesData section:
_TITLE "Permutations with value translator" 'B+ add value translator 2019-03-31 'from "Permutations wo recursion" translate from SmallBasic to QB64 2019-03-31
'from "Permutations" translation from: PowerBASIC, tsh copy from Liberty link 2017-02-04
loadPermsValues results$()
'display result$
PRINT "press any to continue..."
ValuesData:
DATA "Steve","Pete","Fellippe","Bill","Ashish","Qwerky","Petr","TempodiBasic","Colbalt","END"
'this reads data from ValuesData line and translates Permutations to those values
'load values array one way or another? read data
done = 1
n = n + 1
values(n) = r$
DIM a
(0 TO n
+ 1) '+1 needed due to bug in LB that checks loop condition: until (i=0) or (a(i)<a(i+1)) FOR i
= 0 TO n: a
(i
) = i:
NEXT 'load a() with minimum values b$ = ""
b$ = b$ + values(a(i)) + " "
r(e) = b$
e = e + 1
i = n
i = i - 1
j = i + 1
k = n
j = j + 1
k = k - 1
j = i + 1
j = j + 1
362,880 = 9! of permutations of 9 members of this forum. :)