Elevator Saga: An elevator programming game (2015)
11–20 of 103 posts
Re: Elevator Saga: An elevator programming game (2015)
#12I used to interview programmers with an elevator programming problem. Neat to see it expanded so excellently and cleanly in this piece. Well done!
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.
Re: Elevator Saga: An elevator programming game (2015)
#13Are 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)
#14 for(elevator of elevators) {
elevator.on('idle', () => {
//do some logic with elevator
})
}
It only seems to run for the second elevator rather than both of them?Re: Elevator Saga: An elevator programming game (2015)
#15Interesting fact: Gen Fukunaga (https://en.m.wikipedia.org/wiki/Gen_Fukunaga), founder of anime company Funimation, is his son.
Re: Elevator Saga: An elevator programming game (2015)
#16Earlier quoted context omitted.
I'm not sure if this is true. I think all elevators I've encountered followed the elevator/SCAN algorithm: > the elevator continues to travel in its current direction (up or down) until empty, stopping only to let individuals off or to pick up new individuals heading in the same direction. with the elevator staying on its last location if there are no new requests and there being no buffering time after a request, fi…
Have you ever seen elevators where you select a floor from the outside and it gets assigned to one of multiple elevators? Those seem like they might be doing something more sophisticated.
This was made worse through the need to specify the number of people who are travelling to a specific floor so the algorithm can allocate enough space in each elevator. Large groups often ignored this so you’d often find that an elevator you’ve waited minutes for is full, and start the dance all over again.
Re: Elevator Saga: An elevator programming game (2015)
#17What am I doing wrong? for(elevator of elevators) { elevator.on('idle', () => { //do some logic with elevator }) } It only seems to run for the second elevator rather than both of them?
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 ...Re: Elevator Saga: An elevator programming game (2015)
#18Earlier quoted context omitted.
Have you ever seen elevators where you select a floor from the outside and it gets assigned to one of multiple elevators? Those seem like they might be doing something more sophisticated.
I used to have those elevators where I worked and everybody hated them. I think the algorithm was tuned for efficiency, so you’d be waiting for an elevator for minutes as it tries to batch everyone up, while a dozen other elevators sit idle. This was made worse through the need to specify the number of people who are travelling to a specific floor so the algorithm can allocate enough space in each elevator. Large gro…
Same thing happens with traffic lights.
Re: Elevator Saga: An elevator programming game (2015)
#19I 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.
Re: Elevator Saga: An elevator programming game (2015)
#20What am I doing wrong? for(elevator of elevators) { elevator.on('idle', () => { //do some logic with elevator }) } It only seems to run for the second elevator rather than both of them?
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 ...