Live data from Hacker News

Elevator Saga: An elevator programming game (2015)

play.elevatorsaga.com

51–60 of 103 posts

Re: Elevator Saga: An elevator programming game (2015)

#52

What 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 (elevator ... Like that is making a new global variable called elevator which is getting overwritten on the next loop. You need to for(const elevator... (or let).

The other thread is the same answer but for a slightly different case

Re: Elevator Saga: An elevator programming game (2015)

#53
post #29

I always wished elevator buttons could toggle. If you accidentally press the wrong floor, just press it again to cancel. This may not work in all situations, but in some situations, it could be a time saver.

Many modern ones in high rise buildings require you to scan a key fob and/or enter the desired floor number, then it tells you which elevator to go wait at. The ones with the key fob often replace your previous selection automatically.

There are not buttons in this style of elevator other than door open door close and call for help.

Re: Elevator Saga: An elevator programming game (2015)

#54
post #40

During Covid, I've often wished I could reprogram the elevator of the apartment building I live in. The current rule is only 2 people can be in the elevator at a time. Problems 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…

During COVID I think it's totally reasonable for any person to be able to set the elevator as "full" - if you're returning from travel and quarantining, immunocompromised, etc. you might not want to travel with anyone. Also, * Elevator door closes when it's not in use - may as well stay open, get some ventilation, and use slightly less energy!

> any person to be able to set the elevator as "full"

Sadly, in an apartment building there are several people who are selfish. These types would use the feature to monopolize the elevator for moving.

> door closes - stay open?

Prob to reduce the time to travel to a floor. If the doors were open it would add another 15secs in addition to the travel time to reach the called floor.

Re: Elevator Saga: An elevator programming game (2015)

#55

During Covid, I've often wished I could reprogram the elevator of the apartment building I live in. The current rule is only 2 people can be in the elevator at a time. Problems 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…

Another failure: when there's a line, and you already know you'll need multiple cars, the elevator button will still only allow you to call one car at a time. Even if several cars are already on your level with the doors closed.

Re: Elevator Saga: An elevator programming game (2015)

#56
post #15

Made 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…

There is this anecdote in the text "Operations Research, An Introduction." by Hamdy Taha, which I consider to be a very good example of picking the right tools for the job. An OR group was hired to fix elevator wait times in an office building. After studying the problem they installed full-length mirrors at the entrance to the elevators. Complaints around elevator service disappeared as people were now engaged in watching themselves and others while waiting.

Re: Elevator Saga: An elevator programming game (2015)

#57
post #48

elevator.goToFloor(1); elevator.goToFloor(2); elevator.goToFloor(0);

That (or a slight variation) works for the first couple of levels. Then it gets harder.

I was happy that my solution for level 4 was also accepted for level 5 and 6. Only a small tweak was needed for level 7, as now moves were counted instead of time.

The next level required no passenger to wait longer that a certain amount of time, and I would have had to trash half my program, so I quit for now.

Re: Elevator Saga: An elevator programming game (2015)

#58
post #37

Earlier quoted context omitted.

>which floors the elevators idle at... 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 m…

Hopefully you don’t have to spend the time again - but if you do it’s very easy to buy the fireman’s key on eBay. You didn’t hear that here.

Relevant video discussing fire keys and other common keys: https://www.youtube.com/watch?v=a9b9IYqsb_U

And since this thread is about elevators, I have to also mention another video of theirs: https://www.youtube.com/watch?v=ZUvGfuLlZus

Re: Elevator Saga: An elevator programming game (2015)

#59
post #56
post #15

Made 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…

There is this anecdote in the text "Operations Research, An Introduction." by Hamdy Taha, which I consider to be a very good example of picking the right tools for the job. An OR group was hired to fix elevator wait times in an office building. After studying the problem they installed full-length mirrors at the entrance to the elevators. Complaints around elevator service disappeared as people were now engaged in wa…

I first heard of this from Dr. Russell Ackoff's Systems Thinking Speech. I had a mini mind blown moment.

Re: Elevator Saga: An elevator programming game (2015)

#60
Call me weird, but I’ve been fascinated by elevator logic since I was a child. I had a math curiosities book that dedicated a chapter to it and after reading that I was hooked on knowing more.

I wish my knowledge of JavaScript was more than “programming language that’s not Java” so I could actually play this.

Could anyone recommend an online introduction to JS so I can attempt to play this?

I’m more of a bash guy.

Post reply on HN