June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,39 @@
|
|||
Public Sub Main()
|
||||
Dim siCount As Short
|
||||
Dim siCounti As Short = 1
|
||||
Dim siCountj As Short = 2
|
||||
Dim siToSort As Short[] = [249, 28, 111, 36, 171, 98, 29, 448, 44, 147, 154, 46, 102, 183, 24]
|
||||
|
||||
Print "To sort: - ";
|
||||
GoSub Display
|
||||
|
||||
While siCounti < siToSort.Count
|
||||
If siToSort[siCounti - 1] <= siToSort[siCounti] Then
|
||||
siCounti = siCountj
|
||||
Inc siCountj
|
||||
Else
|
||||
Swap siToSort[siCounti - 1], siToSort[siCounti]
|
||||
Dec siCounti
|
||||
If siCounti = 0 Then
|
||||
siCounti = siCountj
|
||||
Inc siCountj
|
||||
Endif
|
||||
Endif
|
||||
Wend
|
||||
|
||||
Print "Sorted: - ";
|
||||
GoSub Display
|
||||
|
||||
Return
|
||||
'--------------------------------------------
|
||||
Display:
|
||||
|
||||
For siCount = 0 To siToSort.Max
|
||||
Print Format(Str(siToSort[siCount]), "####");
|
||||
If siCount <> siToSort.max Then Print ",";
|
||||
Next
|
||||
|
||||
Print
|
||||
Return
|
||||
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue