Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -0,0 +1,38 @@
'randomize 0.5
itemCount = 20
dim item(itemCount)
for i = 1 to itemCount
item(i) = int(rnd(1) * 100)
next i
print "Before Sort"
for i = 1 to itemCount
print item(i)
next i
print: print
't0=time$("ms")
gap=itemCount
while gap>1 or swaps <> 0
gap=int(gap/1.25)
'if gap = 10 or gap = 9 then gap = 11 'uncomment to get Combsort11
if gap <1 then gap = 1
i = 1
swaps = 0
for i = 1 to itemCount-gap
if item(i) > item(i + gap) then
temp = item(i)
item(i) = item(i + gap)
item(i + gap) = temp
swaps = 1
end if
next
wend
print "After Sort"
't1=time$("ms")
'print t1-t0
for i = 1 to itemCount
print item(i)
next i
end