REPLY TO BON AND ALIKE
Not to dis you guys/gals
But i know no one will be next to me in an exam.
The algorithm that i was given was completely screwed up, it followed logic that would drive you nuts. That is why i had a post up here. Not to get people to do my work.
I finally said to the algorithm that i was supposed to follow, SCREW IT, and made my own program.
Here is my code, proving i finished it and did it by myself
-------------------------------------------------------
Dim RandomArray(1 To 1000) As Integer
Dim index As Integer
Private Sub cmdGenerate_Click()
ArrayList.Clear
For index = 1 To 1000
Randomize
RandomArray(index) = Int((Rnd * 1000) + 1)
ArrayList.AddItem (RandomArray(index))
Next index
End Sub
Private Sub cmdSort_Click()
Sort.Clear
For Outer = 1 To 1000
For Inner = 1 To 999
If (RandomArray(Inner) < RandomArray(Inner + 1)) Then
temp = RandomArray(Inner)
RandomArray(Inner) = RandomArray(Inner + 1)
RandomArray(Inner + 1) = temp
End If
Next Inner
Next Outer
For j = 1 To 1000
Sort.AddItem RandomArray(j)
Next j
End Sub
--------------------------------------
I know algorithms and just to re-inforce the one that i was given follow was ridiculous and that is why i was having trouble.