Live data from Hacker News

Elevator Saga – An elevator programming game

play.elevatorsaga.com

91–100 of 108 posts

Re: Elevator Saga – An elevator programming game

#91

Slightly related - SimTower was originally created as an elevator simulator - if you right click on an elevator engine room in the game you get a wealth of programming options

Never even knew all those years playing SimTower... I knew other tricks, but never this.

Re: Elevator Saga – An elevator programming game

#92
post #85
post #81

Earlier quoted context omitted.

I'm not a developer of the game but: DestinationQueue handling: It is not redundant, those are different options. Just to give an valid example: Add something to the queue, sort the queue, make the elevator run the updated and sorted queue. Having both goingUpIndicator and goingDownIndicator is probabaly necessary to get this abritrary third state (both enabled / both disabled) which essentially indicates that the el…

Yeah this is basically correct. There is nothing really preventing an elevator from reporting that it's going both up and down. The up/down indicators are used for two things: 1. To shut off the up/down request indicators correctly on the floor when the elevator arrives. 2. By passengers to decide whether to get on an elevator or not.

Thanks, I'm having a hard time with those indicators as well. One question. If I never set the indicators in my code, do they automatically get set? Or are the passengers getting on the car when there is no indicator?. (So far I've been having a lot of people refuse to get on my car, and I assume it's because my code is setting the wrong indicator).

BTW, this is a game that will haunt me for a long time to come. Even when I pass a level, I stay on it trying to reduce the metrics rather than accept that I "lucked out" with my naive algorithm. You did a fantastic job on this.

Re: Elevator Saga – An elevator programming game

#93
post #81
post #74

A couple of problems with the API. First, why do you have to call checkDestinationQueue after modifying the queue? It's awfully redundant. I assume this is due to some kind of limitation. And second, goingUpIndicator and goingDownIndicator are kind of sketchy. Can you activate both at the same time? What effect would that have? There should be a single property, directionIndicator of an enum type with the possible va…

I'm not a developer of the game but: DestinationQueue handling: It is not redundant, those are different options. Just to give an valid example: Add something to the queue, sort the queue, make the elevator run the updated and sorted queue. Having both goingUpIndicator and goingDownIndicator is probabaly necessary to get this abritrary third state (both enabled / both disabled) which essentially indicates that the el…

correct, those works as flag with 'accept passenger in these direction' meaning. also note that if you change those values while you are at a floor, you need to go to that floor again for passenger to notice.

Re: Elevator Saga – An elevator programming game

#95
post #84

Developer here! Thanks for all the feedback. Appreciate all of it, including bug reports! Pull requests also welcome. Especially I would appreciate help with adding more challenges, and/or making them all balanced and interesting, for a good and reasonable difficulty curve. It is very simple to tweak them - they are defined at the bottom of challenges.js: https://github.com/magwo/elevatorsaga/blob/master/challenges..…

hi, why leaving the elevator at a floor doesn't pick up additional passengers? i.e.

http://pastebin.com/xA4NJbas @ http://play.elevatorsaga.com/#challenge=2

(yes that's only a stub, but has logging as I was trying to understand the event order)

at least elevator.goToFloor(elevator.currentFloor());

doesn't count as a move and unlocks the passenger to onboarding

btw, when you start you get 2 moves per elevator in the moves count

Re: Elevator Saga – An elevator programming game

#97
post #90

Earlier quoted context omitted.

Many languages are expressions (as opposed to statements) including C-like languages. I've always thought that 'return' itself was redundant. If a compound statement was defined to return the value of the final (executed) statement, then functional methods would get much simpler. And remove the need for the '?' operator for instance. e.g. int foo(int x) { bar(x,y); } or x = {if (foo() > 9) true; else false; }

I think one problem with statements-as-expression is that is not always evident which should be their result. for instance: bool r = if (test()) { false; } else { true; } what r should be set to? true or false ? I don't see the point of adding such complexity.. it's waaay more clear to be explicit bool r = test(); if (r) { false; } else { true; } or, if you intended the other way bool r; if (test()) { r = false; } el…

I'm missing your point I guess. All those are equivalent? In C an assignment has the value of the RHS, so that doesn't change anything in these examples.

Re: Elevator Saga – An elevator programming game

#98
post #85

Earlier quoted context omitted.

Yeah this is basically correct. There is nothing really preventing an elevator from reporting that it's going both up and down. The up/down indicators are used for two things: 1. To shut off the up/down request indicators correctly on the floor when the elevator arrives. 2. By passengers to decide whether to get on an elevator or not.

Thanks, I'm having a hard time with those indicators as well. One question. If I never set the indicators in my code, do they automatically get set? Or are the passengers getting on the car when there is no indicator?. (So far I've been having a lot of people refuse to get on my car, and I assume it's because my code is setting the wrong indicator). BTW, this is a game that will haunt me for a long time to come. Even…

I think they are automatically set to true at the start, and will never change unless you change them.

Re: Elevator Saga – An elevator programming game

#99

Slightly related - SimTower was originally created as an elevator simulator - if you right click on an elevator engine room in the game you get a wealth of programming options

The people in that game were a lot smarter though; if the only path to a floor required switching elevators, they would do it.
Post reply on HN