Sorting algorithms/Bogosort: Difference between revisions

Added 11l
(Added Quackery)
(Added 11l)
Line 24:
The [[Knuth shuffle]] may be used to implement the shuffle part of this algorithm.
<br><br>
=={{header|11l}}==
<lang 11l>F is_sorted(data)
R all((0 .< data.len - 1).map(i -> @data[i] <= @data[i + 1]))
 
F bogosort(&data)
L !is_sorted(data)
random:shuffle(&data)
 
V arr = [2, 1, 3]
bogosort(&arr)
print(arr)</lang>
 
{{out}}
<pre>
[1, 2, 3]
</pre>
 
=={{header|AArch64 Assembly}}==
{{works with|as|Raspberry Pi 3B version Buster 64 bits}}
Line 201 ⟶ 218:
.include "../includeARM64.inc"
</lang>
 
=={{header|ActionScript}}==
<lang actionscript>public function bogoSort(arr:Array):Array
1,463

edits