2 ms·
Yup, I tried this a while back and gave up after not being able to figure out where/how the queue worked.
by alar44 4y ago
Yup, I tried this a while back and gave up after not being able to figure out where/how the queue worked.
- tuukkah 4y agoYes, it's unfortunate that the game starts very easy but then immediately becomes quite difficult even requiring some reverse engineering. Basically, each elevator has a queue of the floors where it's going next. The elevator will always try to move to the floor at the front of the queue. When it stops at the destination floor, it removes that floor from the front of the queue. Whenever the queue is empty, the idle event triggers. elevator.goToFloor(floorNumber); // Adds floorNumber to the end of the queue elevator.goToFloor(floorNumber, true); // Adds floorNumber to the front of the queue (changing the destination immediately) elevator.stop(); // Clears the queue (stopping the elevator immediately) I suppose you can use your own queue data structure instead and keep at most one element in the built-in queue just to control the current direction of the elevator.