Sorting algorithms/Bogosort: Difference between revisions
Content added Content deleted
(→Insitux: correction) |
|||
Line 3,553: | Line 3,553: | ||
=={{header|Yabasic}}== |
=={{header|Yabasic}}== |
||
{{trans|FreeBASIC}} |
{{trans|FreeBASIC}} |
||
<syntaxhighlight lang="yabasic"> |
<syntaxhighlight lang="yabasic">dim a(5) |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
sub shuffle(a()) |
sub shuffle(a()) |
||
n = arraysize(a(),1) |
n = arraysize(a(),1) |
||
Line 3,571: | Line 3,580: | ||
for i = 0 to n-2 |
for i = 0 to n-2 |
||
if a(i) > a(i+1) |
if a(i) > a(i+1) return false |
||
next i |
next i |
||
return true |
return true |
||
Line 3,580: | Line 3,589: | ||
shuffle(a()) |
shuffle(a()) |
||
wend |
wend |
||
end sub |
end sub</syntaxhighlight> |
||
dim a(5) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</syntaxhighlight> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |