|
-
Jan 24th, 2002, 04:27 PM
#1
Thread Starter
Hyperactive Member
-
Jan 24th, 2002, 05:16 PM
#2
Thread Starter
Hyperactive Member
dont worry bout that, i found on on google 
thanks all the same
Ang
-
Jan 26th, 2002, 12:26 PM
#3
I sincerely hope you are not planning to use a variant of the dreadful bubble sort!
PS, whats an O2?
-
Feb 2nd, 2002, 06:45 AM
#4
This has been bugging me for a few days now...Just what algorithm are you using?
I heartily recommend the Counting sort algorithm, for such a small number of items.
-
Feb 2nd, 2002, 08:00 PM
#5
-
Feb 3rd, 2002, 02:43 PM
#6
Thread Starter
Hyperactive Member
here is my sorting procedure, its a bit hairy, hope u can follow it 
For i = 0 To (FinalBagCount - 1)
Biggest = i
For j = (i + 1) To FinalBagCount - 1
If (BagArray(Biggest).GetO2 < BagArray(j).GetO2) Then Biggest = j
Next j
tempb.CopyBag Bag:=BagArray(i)
tempf.CopyFilm Film:=FilmArray(i)
BagArray(i).CopyBag Bag:=BagArray(Biggest)
FilmArray(i).CopyFilm Film:=FilmArray(Biggest)
BagArray(Biggest).CopyBag Bag:=tempb
FilmArray(Biggest).CopyFilm Film:=tempf
Next i
puts them in descending order........... what i really want to do is sort it by closest to Produce.Optimums, what i had was:
For i = 0 To (FinalBagCount - 1)
Biggest = i
For j = (i + 1) To FinalBagCount - 1
BagDiff1 = Absolute(BagArray(Biggest).GetO2 - Produce.GetOptO2)
BagDiff2 = Absolute(BagArray(j).GetO2 - Produce.GetOptO2)
If (BagDiff1 > BagDiff2) Then Biggest = j
Next j
tempb.CopyBag Bag:=BagArray(i)
tempf.CopyFilm Film:=FilmArray(i)
BagArray(i).CopyBag Bag:=BagArray(Biggest)
FilmArray(i).CopyFilm Film:=FilmArray(Biggest)
BagArray(Biggest).CopyBag Bag:=tempb
FilmArray(Biggest).CopyFilm Film:=tempf
Next i
only this didnt sort them correctly. can anyone tell me why?
-
Feb 3rd, 2002, 03:06 PM
#7
Thread Starter
Hyperactive Member
oh i figured out why it didnt work. I was using integers when it should have been singles. haha
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|