icp/oer/courses/c-newcomers/sections/03-lift/05-pending-goal/content.md

528 B

The lift can now reach exactly one target floor. But a lift can get more than one request. For now we only take a second one.

Model

So now our model is able to have multible targets. Basically a active one safed in TargetFloor and a secondary one saved in PendingFloor. This lift controller should prioritize the target floor first, but, if there is any pending floor that can be done one the way, it should stop there. Otherwise you have to update the target floor.

Task

Your task is to program that behavior.