Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
25
Task/Permutations/Run-BASIC/permutations.basic
Normal file
25
Task/Permutations/Run-BASIC/permutations.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
list$ = "h,e,l,l,o" ' supply list seperated with comma's
|
||||
|
||||
while word$(list$,d+1,",") <> "" 'Count how many in the list
|
||||
d = d + 1
|
||||
wend
|
||||
|
||||
dim theList$(d) ' place list in array
|
||||
for i = 1 to d
|
||||
theList$(i) = word$(list$,i,",")
|
||||
next i
|
||||
|
||||
for i = 1 to d ' print the Permutations
|
||||
for j = 2 to d
|
||||
perm$ = ""
|
||||
for k = 1 to d
|
||||
perm$ = perm$ + theList$(k)
|
||||
next k
|
||||
if instr(perm2$,perm$+",") = 0 then print perm$ ' only list 1 time
|
||||
perm2$ = perm2$ + perm$ + ","
|
||||
h$ = theList$(j)
|
||||
theList$(j) = theList$(j - 1)
|
||||
theList$(j - 1) = h$
|
||||
next j
|
||||
next i
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue