They can be. Express elevators and such. But mainly the programs are limited to what floor the elevators idle at because more complicated programs even if more efficient overall often piss people off.
I recently spent 4 months in hospital which left me with an amount of time to kill in an attempt to stay sane. One of the games was trying to get places I was technically allowed but really shouldn't have been ("sod your 'no public access' signs, in not public, I'm an inpatient!"). Being confined to a wheelchair made the game a bit more difficult.
One day one of the ward staff mentioned that the building used to have a 4th floor which got mothballed years ago. None of the elevators had a button for it and trying to get up a flight of stairs wasn't an option.
After puzzling for a while, I finally realised that one of the elevators was still set to idle on the 4th floor. Get in the elevator, don't press any buttons, read a book for 10 minutes and bam - elevator returns itself to the 4th floor, opens the doors and goes ping. I wheel myself out to find I'm not just on the 4th floor, but also behind (on the inside of) the locked doors at the top of the stairs, which I counted as a double win ;)
That's amazing. I'll be trying that trick next time I have some time to kill in a building!
We also play the game sometimes of getting places we're not supposed to (as consultants). Walk around like you're from IT and are supposed to be there (technically both true), perhaps with a laptop under your arm, nobody will care what you do to any of the computers there. In schools and hospitals, and probably other places, try (variants of) the city you're in as password, perhaps combined with the postal code, and you usually get access to everything because of course the staff needs to actually help you. The username is pre-filled, don't worry about that (most of the time that's the field with more entropy).
It's honestly terrifying and short of locking rooms (because some of the personnel needs fast access to computers, preferably faster than plugging in and out smartcards all day long) there just isn't really a solution. I'm pretty sure we could have walked into a surgery room, we steered clear of any place that looked like it might head us into places with patients under actual operation. Why those aren't locked I don't know, probably there is a good reason so probably they can't change that...
I'm sure for surgery rooms (at least), needing someone to rush in to help and having them fumble with ID cards outweighs a bad party trying to, I guess, muck up a surgery or something.
in the hospitals that i have been for visits usually the whole intensive care area and other sensitive areas were access controlled. so while the door to the actual surgery room might have been open, you are often not even allowed anywhere near.
Very rarely do you have people rushing in to surgery rooms. Despite TV dramas, most surgeries are not high risk, most surgical patients are not critically ill, and those that are tend to be pre-staffed for the risk. OR rooms are not usually locked but the surgical suite sure is. The bigger issue with the surgical suite is proper attire. ICUs are a different matter (where coincidentally I happen to be tonight). Generally all the staff you need is already on the locked side of the unit.
our elevator allows undoing pressed buttons. if no buttons are pressed, then the elevator will stop. now you could play a game where you try to get the elevator to stop at a particular floor without pressing that floors button.
the only downside is that our elevator does not open the doors if no button is pressed, so any off-limit floors would remain inaccessible
The logic to pick up passengers is the easy part of a real elevator. Some harder problems: a) Physics. How to drive the motors to move smoothly and efficiently to the desired floor and stop level with the landing. b) Safety and regulatory. There are lots of safety features that need to be implemented, e.g. control by fire fighters. c) Customization. There are lots of special cases, either for customer desires or laws in different states. d) Networking. How do you get the signals from the hall call buttons to the controller and from the controller to the hall lanterns? Tons of wires or a protocol? e) Diagnostics and failure handling. What do you do if something goes wrong? What do you log for maintenance?