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”
Best solution I’ve seen, Crabs. Fucking awesome.
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.