/elevatorSaga

Solution for elevatorSaga

Primary LanguageJavaScript

elevator-saga

Elevator Saga solutions for v1.6.5

Currently works upto challenge #9!

Implementation

There are global queues for up button press and down button press. When an elevator is idle it picks up from the relevant up queue or down queue based on its current position. Each elevator also normally traverses to a floor when a floor button is pressed from within an elevator, like normal elevators do. When traversing through floors there is also a check to see if the passing floor is present in the relevant directional queue and can be handle immediately.

Also has colored console logs for debugging.

Author

Shalom Sam