Computer Science Canada

array in order

Author:  scorpion1087 [ Tue Oct 14, 2003 6:19 pm ]
Post subject:  array in order

how do i display the numbers in an array in order?

Author:  Tony [ Tue Oct 14, 2003 8:28 pm ]
Post subject: 

You should read a tutorial on arrays, I've wrote one here

If there's something you're interested in, check tutorials to see there's anything posted about it Wink

Author:  Blade [ Wed Oct 15, 2003 11:57 am ]
Post subject: 

teacher taught us to bubble sort like this...
code:
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..

Author:  Dan [ Wed Oct 15, 2003 10:58 pm ]
Post subject: 

thats defutaly not the traditan way of doing bubble sort. it uhsaly uses two for loops and dose not have a exit when line Confused


: