hi guys, for my HNC project i'm making an elevator programme that decides which floor to visit depending on the direction is has just traveled and i'm having trouble finding code that i could use to sort the input from the user and then sort this.
E.G if the elevator traveled from floor 1 to 5 and then floors 4 and 6 are selected at the same time. i want the elevator to go to floor 6 first as it travel up to get to floor 5, then go to floor 4. if you get what i mean, any help would be great as i'm well and truly stumped



1Likes
LinkBack URL
About LinkBacks




ill have a look through them later and hopefully upload some code you can nitpick, i was thinking of using an array as i will only be using 10 floors, using an if statement to decided on which way to sort them depending on the way the lift traveled (accending for lift up and deciding for lift down) and then storing then other inputs until the elevator reaches the lowest input floor? 