Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,56 @@
|
|||
define sort = 0, index = 0, size = 10
|
||||
define temp1 = 0, temp2 = 0
|
||||
|
||||
dim list[size]
|
||||
|
||||
gosub fill
|
||||
gosub sort
|
||||
gosub show
|
||||
|
||||
end
|
||||
|
||||
sub fill
|
||||
|
||||
for index = 0 to size - 1
|
||||
|
||||
let list[index] = int(rnd * 100)
|
||||
|
||||
next index
|
||||
|
||||
return
|
||||
|
||||
sub sort
|
||||
|
||||
do
|
||||
|
||||
let sort = 0
|
||||
for index = 0 to size - 2
|
||||
|
||||
let temp1 = index + 1
|
||||
|
||||
if list[index] > list[temp1] then
|
||||
|
||||
let temp2 = list[index]
|
||||
let list[index] = list[temp1]
|
||||
let list[temp1] = temp2
|
||||
let sort = 1
|
||||
|
||||
endif
|
||||
|
||||
next index
|
||||
|
||||
wait
|
||||
|
||||
loop sort = 1
|
||||
|
||||
return
|
||||
|
||||
sub show
|
||||
|
||||
for index = 0 to size - 1
|
||||
|
||||
print index ," : ", list[index]
|
||||
|
||||
next index
|
||||
|
||||
return
|
||||
Loading…
Add table
Add a link
Reference in a new issue