Lift Control system

Hi, i need to program and simulate a 2 floor lift control system. can anyone tell me how to do that ? i need to design its program only.

Make an numeric array of say size 10, each index of the array would be a floor. Where the actual lift is would be indicated by a value 1 and where it is not would be a 0

so...

array[0] = ground floor
array[1] = level 1
array[2] = level 2

... and so on

so if person in lift hits floor 3, you would move up the index placing a 1, clearing the previous position back to 0 until you reach floor 3.
Topic archived. No new replies allowed.