Permutations: Difference between revisions

→‎{{header|Glee}}: Glee example added
(→‎{{header|Glee}}: Glee example added)
Line 2,241:
[ 2, 1, 3 ], [ 2, 3, 1 ],
[ 3, 1, 2 ], [ 3, 2, 1 ] ]</lang>
 
 
=={{header|Glee}}==
<lang glee>$$ n !! k dyadic: Permutations for k out of n elements (in this case k = n)
$$ #s monadic: number of elements in s
$$ ,, monadic: expose with space-lf separators
$$ s[n] index n of s
 
'Hello' 123 7.9 '•'=>s;
s[s# !! (s#)],,</lang>
 
Result:
<lang glee>Hello 123 7.9 •
Hello 123 • 7.9
Hello 7.9 123 •
Hello 7.9 • 123
Hello • 123 7.9
Hello • 7.9 123
123 Hello 7.9 •
123 Hello • 7.9
123 7.9 Hello •
123 7.9 • Hello
123 • Hello 7.9
123 • 7.9 Hello
7.9 Hello 123 •
7.9 Hello • 123
7.9 123 Hello •
7.9 123 • Hello
7.9 • Hello 123
7.9 • 123 Hello
• Hello 123 7.9
• Hello 7.9 123
• 123 Hello 7.9
• 123 7.9 Hello
• 7.9 Hello 123
• 7.9 123 Hello</lang>
 
=={{header|Go}}==
136

edits