Sorting algorithms/Bubble sort: Difference between revisions
→{{header|Craft Basic}}
(Sorting algorithms/Bubble sort in True BASIC) |
Basicgames (talk | contribs) |
||
Line 1,301:
dim list[size]
gosub fill
gosub sort
gosub show
end
let list[index] = int: (rnd) * 100▼
sub fill
let index = index + 1▼
print index
let sort = 0▼
return
▲ let index = 0
sub sort
do
let
if list[index] > list[temp1] then
let temp2 = list[index]
let list[index] = list[temp1]
let list[temp1] = temp2
let sort = 1
endif
▲ loop index < size - 1
▲ wait
return
sub show
for index = 0 to size - 1
==={{header|FreeBASIC}}===
|