Sorting algorithms/Bogosort: Difference between revisions

Content added Content deleted
(Added a solution for MATLAB)
(Added PicoLisp)
Line 1,007: Line 1,007:
return TRUE;
return TRUE;
}</lang>
}</lang>

=={{header|PicoLisp}}==
<lang PicoLisp>(de bogosort (Lst)
(loop
(map
'((L) (rot L (rand 1 (length L))))
Lst )
(T (apply <= Lst) Lst) ) )</lang>
Output:
<pre>: (bogosort (make (do 9 (link (rand 1 999)))))
-> (1 167 183 282 524 556 638 891 902)

: (bogosort (make (do 9 (link (rand 1 999)))))
-> (20 51 117 229 671 848 883 948 978)

: (bogosort (make (do 9 (link (rand 1 999)))))
-> (1 21 72 263 391 476 794 840 878)</pre>

=={{header|PureBasic}}==
=={{header|PureBasic}}==
<lang PureBasic>Procedure KnuthShuffle (Array a(1))
<lang PureBasic>Procedure KnuthShuffle (Array a(1))