Anonymous user
Sorting algorithms/Bogosort: Difference between revisions
no edit summary
(Added Prolog) |
No edit summary |
||
Line 1,689:
IO.Put("\nRequired " & Fmt.Int(count) & " shuffles\n");
END Bogo.</lang>
=={{header|Nanoquery}}==
<lang nanoquery>def sorted(list)
if len(list) = 0
return true
end
for i in range(0, len(list) - 2)
if list[i] > list[i + 1]
return false
end
end
return true
end
def bogosort(list)
while not sorted(list)
list = list.shuffle()
end
return list
end</lang>
=={{header|Nemerle}}==
|