kbraaten
02-04-2007, 01:36 AM
hey guys i am currently having some problems with identifying what each line in the following sort array is doing in qbasic:
FOR ctrsort1 = 1 TO 6
FOR ctrsort2 = ctrsort1 + 1 TO 6
IF RegularNumber(ctrsort1) > RegularNumber(ctrsort2) THEN
SWAP RegularNumber(ctrsort1), RegularNumber(ctrsort2)
END IF
NEXT ctrsort2
NEXT ctrsort1
any help you guys could give would be greatly appreciated, i think i have a very foggy concept of what is going on but some guidance would be great
FOR ctrsort1 = 1 TO 6
FOR ctrsort2 = ctrsort1 + 1 TO 6
IF RegularNumber(ctrsort1) > RegularNumber(ctrsort2) THEN
SWAP RegularNumber(ctrsort1), RegularNumber(ctrsort2)
END IF
NEXT ctrsort2
NEXT ctrsort1
any help you guys could give would be greatly appreciated, i think i have a very foggy concept of what is going on but some guidance would be great