Jump to content

Permutations: Difference between revisions

Added Uiua solution
(Added Uiua solution)
Line 9,601:
</pre>
 
=={{header|Uiua}}==
 
 
<syntaxhighlight lang="uiua">
# Takes strict range 0..<n and generates n! permutations
# (from https://github.com/Omnikar/uiua-math/blob/main/lib.ua).
Perms ← ☇1⍉∧(≡↻⇡⟜↯+1⟜⊂):¤¤°⊂
 
Permute ← ≡⊏⊙¤⊸(Perms⇡⧻) # Generalised helper function.
⟜⧻Permute {"this" "is" "fine"} # Yoda simulator
</syntaxhighlight>
{{out}}
<pre>
6
╭─
╷ ⌜fine⌟ ⌜is⌟ ⌜this⌟
⌜fine⌟ ⌜this⌟ ⌜is⌟
⌜is⌟ ⌜this⌟ ⌜fine⌟
⌜this⌟ ⌜is⌟ ⌜fine⌟
⌜this⌟ ⌜fine⌟ ⌜is⌟
⌜is⌟ ⌜fine⌟ ⌜this⌟
</pre>
=={{header|UNIX Shell}}==
{{works with|Bourne Again SHell}}
158

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.