
-----------------------------------
scorpion1087
Tue Oct 14, 2003 6:19 pm

array in order
-----------------------------------
how do i display the numbers in an array in order?

-----------------------------------
Tony
Tue Oct 14, 2003 8:28 pm


-----------------------------------
You should read a tutorial on arrays, I've wrote one [url=http://www.compsci.ca/v2/viewtopic.php?t=366]here

If there's something you're interested in, check tutorials to see there's anything posted about it  :wink:

-----------------------------------
Blade
Wed Oct 15, 2003 11:57 am


-----------------------------------
teacher taught us to bubble sort like this...
var switch:boolean:=false
var ii:int:=0
var temp:string:=""
loop
  ii+=1
  for i:1..10 - ii
    if(nums(i) > nums(i+1))then
      temp:=nums(i)
      nums(i):=nums(i+1)
      nums(i+1):=temp
      switch:=true
    end if  
  end for
  exit when not switch or ii >= 10
end loop

cant remember for sure, and i cant test it and figure it out right now cuz i'm gonna be late..

-----------------------------------
Dan
Wed Oct 15, 2003 10:58 pm


-----------------------------------
thats defutaly not the traditan way of doing bubble sort. it uhsaly uses two for loops and dose not have a exit when line  :?
