Earlier quoted context omitted.
i likely ran into the same or a related issue. i dont know much about javascript though. for(var i = 0; i it only works for "i < 1" and then only the second elevator moves... its kinda sad as i immediately enjoyed playing ...
I think this was discussed there: https://news.ycombinator.com/item?id=8933979
Elevator Saga: An elevator programming game (2015)
21–30 of 103 posts
Re: Elevator Saga: An elevator programming game (2015)
#22Are real elevators ever coded with logic like mentioned in this thread? Or do they just keep it a simple as possible?
Re: Elevator Saga: An elevator programming game (2015)
#23I don't remember the article but I remember reading about a building management game where the reviewer believed the entire game was based around the elevator management code and that writing that code was fun for the programmer but the game itself was not fun for the player. It looks like this highlights the "fun for the programmer" part.
[1] https://archive.org/details/SimTower_-_Manual_-_PC/page/n7/m...
Re: Elevator Saga: An elevator programming game (2015)
#24I used to interview programmers with an elevator programming problem. Neat to see it expanded so excellently and cleanly in this piece. Well done!
I had this question during a Google interview. The interviewer became annoyed when I suggested that an elevator that sometimes went backwards to pick ip someone on a just-missed floor could at least be interesting, if not perfectly efficient. They had a preconceived idea that they wanted a stateless system and didn’t like my stateful approach, even if it was potentially better for end users.
I've had a similar idea around measuring how many riders make calls over say the past 100 rides, and then trying to calculate how efficient it might be to deviate a few floors either direction to grab someone close-by. It's an interesting hole to climb into.
Did you get the gig at google?
Re: Elevator Saga: An elevator programming game (2015)
#25Re: Elevator Saga: An elevator programming game (2015)
#26Are real elevators ever coded with logic like mentioned in this thread? Or do they just keep it a simple as possible?
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 ;)
Re: Elevator Saga: An elevator programming game (2015)
#27Problems that arise:
* Elevator stopping frequently, but already at capacity, slowing down overall performance
* Elevator always goes to bottom (or top) first to pick up passengers going up (or down). This means if your waiting on the ground floor and it's a busy time, folks at the parking levels will repeatedly get picked up before you.
Possible solutions:
* First come, first served (need to remember order of what floor pushed button when)
* Ability to set elevator as "full". Even if abused by a single person, still better than multiple wasted stops.
Re: Elevator Saga: An elevator programming game (2015)
#28Re: Elevator Saga: An elevator programming game (2015)
#29Re: Elevator Saga: An elevator programming game (2015)
#30Made me remember an interesting anecdote: During my PhD at Purdue I had the good luck to take the Pattern Recognition (nowadays would be called ML) course from Prof. Fukunaga, one of the pioneers in the field ( https://en.m.wikipedia.org/wiki/Keinosuke_Fukunaga ). In one of his classes he mentioned that years ago a company came to him, requesting his expertise in optimizing movement of a bank of elevators. He thought…