RosettaCodeData/Task/Permutations/EasyLang/permutations.easy

14 lines
232 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
proc permlist k . list[] .
2023-10-02 18:11:16 -07:00
if k = len list[]
print list[]
return
.
2023-07-01 11:58:00 -04:00
for i = k to len list[]
swap list[i] list[k]
2023-09-16 17:28:03 -07:00
permlist k + 1 list[]
2023-07-01 11:58:00 -04:00
swap list[k] list[i]
.
.
l[] = [ 1 2 3 ]
2023-09-16 17:28:03 -07:00
permlist 1 l[]