Sorting algorithms/Bogosort: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
(add BQN)
Line 828: Line 828:
383150 shuffles required to sort 10 items.
383150 shuffles required to sort 10 items.
</pre>
</pre>

=={{header|BQN}}==
Requires the <code>_while_</code> idiom because the recursive version <code>{(π•Šπ•©βŠΛœβ€’rand.Dealβˆ˜β‰ )⍟(π•©β‰’βˆ§π•©)𝕩}</code> quickly runs out of stack depth.

<syntaxhighlight lang="bqn">_while_←{π”½βŸπ”Ύβˆ˜π”½_𝕣_π”Ύβˆ˜π”½βŸπ”Ύπ•©}
Bogo←{π•©βŠΛœβ€’rand.Deal≠𝕩}_while_(β‰’βŸœβˆ§)</syntaxhighlight>


=={{header|Brat}}==
=={{header|Brat}}==