Elevator Instructions—Crabs(123)

You can eliminate the (123) if you desire, Crabs.
—DSH

  • Open doors when arrived at “destination floor”
  • Close doors after 10 seconds of no motion detected
  • Light any button when pressure is applied
  • When “floor request button” is lit, put coordinating floor in “request queue”
  • If moving “up”, set “destination floor” to the nearest higher floor in “request queue”
  • If moving “down”, set “destination floor” to the nearest lower floor in “request queue”
  • Eliminate request from “request queue” when arrived at “destination floor”
  • When “up button” or “down button” is lit put floor where button is lit on the “request queue”
  • If there are no floors in “request queue” that is higher than “current floor” then set “destination floor” to nearest lower floor in “request queue”
  • If there are no floors in “request queue” that is lower than “current floor” then set “destination floor” to nearest higher floor in “request queue”
  • Update “current floor” each time a floor is reached
  • Close door when “close door button” is lit unless motion is detected
  • Open door when “open door button” is lit
  • When “emergency button” is pressed dial 911 and repeat an automated voice message that says “ Emergency elevator call from “insert address here”
This entry was posted in Crabs123, Elevator Instructions. Bookmark the permalink.

1 Response to Elevator Instructions—Crabs(123)

  1. davidbdale's avatar davidbdale says:

    Best solution I’ve seen, Crabs. Fucking awesome.

    • Once I figured out which was the “floor request” button and which was the “up button,” the rest fell into place.
    • Establishing a queue was genius.
    1. As I understand it, the “request queue” is an unordered queue that does not distinguish between “floor requests” and “up” or “down” requests. It also ignores the chronological order in which requests were placed.
    2. That resolves ambiguity and works in every case I can imagine.
    3. But it deserves to be pointed out that it resolves the chronological ambiguity WITHOUT HAVING TO SAY anything at all, which is my paradigm for excellence.
    4. For example:
    5. The elevator headed UP to respond to a DOWN button on the fifth floor WILL NOT OPEN along the way to respond to a DOWN button call from the fourth floor, but it WILL OPEN along the way to respond to a fourth floor DESTINATION request from a passenger already on the elevator.
    6. The would-be passenger in the fourth-floor hallway waiting for a down elevator might THINK the elevator is responding to the DOWN call when the doors open, but it’s not.
    7. This is how elevators actually work.
    8. The only thing you haven’t mentioned (if you take this on for extra credit I will be VERY impressed) is that a so-far-unmentioned pair of UP and DOWN arrow-shaped lights are set into the frame of most modern elevator doors, visible only when the doors are open.
    9. When that would-be passenger on the fourth floor sees the doors open, she can tell from the lighted UP arrow that the elevator will proceed UP until it reaches its highest “destination floor” before returning to the fourth floor to respond to her DOWN request.
    10. Finally, outside the elevator, in the fourth floor hallway, the DOWN button responding to her Down request will remain lit until the elevator returns to collect her.

    Can you handle it? I believe you can. I further believe you’ll be able to do it as elegantly as you have managed the rest.

    I’ve never given 100/100 on any assignment, but I’m prepared to.

Leave a comment