Permutations: Difference between revisions
Content added Content deleted
Langurmonkey (talk | contribs) |
(Added Uiua solution) |
||
Line 9,601: | Line 9,601: | ||
</pre> |
</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}}== |
=={{header|UNIX Shell}}== |
||
{{works with|Bourne Again SHell}} |
{{works with|Bourne Again SHell}} |