June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,49 @@
|
|||
siLow As Short = -99 'Set the lowest value number to create
|
||||
siHigh As Short = 99 'Set the highest value number to create
|
||||
siQty As Short = 20 'Set the quantity of numbers to create
|
||||
|
||||
Public Sub Main()
|
||||
Dim siToSort As Short[] = CreateNumbersToSort()
|
||||
Dim siPos, siLow, siChar, siCount As Short
|
||||
|
||||
PrintOut("To sort: ", siToSort)
|
||||
|
||||
For siCount = 0 To siToSort.Max
|
||||
siChar = siCount
|
||||
For siPos = siCount + 1 To siToSort.Max
|
||||
If siToSort[siChar] > siToSort[siPos] Then siChar = siPos
|
||||
Next
|
||||
siLow = siToSort[siChar]
|
||||
siToSort.Delete(siChar, 1)
|
||||
siToSort.Add(siLow, siCount)
|
||||
Next
|
||||
|
||||
PrintOut(" Sorted: ", siToSort)
|
||||
|
||||
End
|
||||
'---------------------------------------------------------
|
||||
Public Sub PrintOut(sText As String, siToSort As String[])
|
||||
Dim siCount As Short
|
||||
|
||||
Print sText;
|
||||
|
||||
For siCount = 0 To siToSort.Max
|
||||
Print siToSort[siCount];
|
||||
If siCount <> siToSort.max Then Print ", ";
|
||||
Next
|
||||
|
||||
Print
|
||||
|
||||
End
|
||||
'---------------------------------------------------------
|
||||
Public Sub CreateNumbersToSort() As Short[]
|
||||
Dim siCount As Short
|
||||
Dim siList As New Short[]
|
||||
|
||||
For siCount = 0 To siQty
|
||||
siList.Add(Rand(siLow, siHigh))
|
||||
Next
|
||||
|
||||
Return siList
|
||||
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue