2022-10-27 22:32:20 +02:00
|
|
|
factorial := (n | fold '* (1 + up n)),
|
2022-06-02 23:17:02 +02:00
|
|
|
|
|
|
|
|
2022-10-25 16:10:34 +02:00
|
|
|
list_all_permutations := ( array |
|
|
|
|
for (up (factorial (len array))) (|
|
2022-10-27 22:32:20 +02:00
|
|
|
say array,
|
|
|
|
array = permute array,
|
|
|
|
),
|
|
|
|
),
|
2022-10-25 16:10:34 +02:00
|
|
|
|
2022-10-27 22:32:20 +02:00
|
|
|
list_all_permutations (1 + up 5),
|