Sorting algorithms/Bogosort: Difference between revisions
Content deleted Content added
Line 258: | Line 258: | ||
</pre> |
</pre> |
||
=={{header|Icon}}== |
=={{header|Icon}}== |
||
procedure shuffle(l) |
procedure shuffle(l) |
||
repeat { |
repeat { |
||
Line 266: | Line 267: | ||
procedure sorted(l) |
procedure sorted(l) |
||
local |
local i |
||
⚫ | |||
o := l[1] |
|||
⚫ | |||
return 1 |
|||
end |
end |
||
procedure main() |
procedure main() |
||
local l |
local l |
||
l := [6,3,4] |
l := [6,3,4,5,1] |
||
|( shuffle(l) & sorted(l)) \1 & every writes(" ",!l) |
|||
every writes(" ",!m) |
|||
end |
end |
||
=={{header|J}}== |
=={{header|J}}== |