Live data from Hacker News

Elevator Saga – An elevator programming game

play.elevatorsaga.com

101–108 of 108 posts

Re: Elevator Saga – An elevator programming game

#103
post #62

Earlier quoted context omitted.

They have that at work and it takes far longer to get an elevator. It's always annoying going to those buildings and using those elevators.

I like it much more. Yes, getting an elevator might take longer, but total travel time should be reduced. (Otherwise, the system is programmed wrong.)

As well as the overall throughput of the elevator system should be improved a lot.

Re: Elevator Saga – An elevator programming game

#104
post #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.

Well Sim tower had range limit elevators. This game doesn't.

Re: Elevator Saga – An elevator programming game

#105
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 m…

The last one about moves has been fixed.

The additional-people-not-getting-on is kind of an architectural problem with the game, working on it.

Re: Elevator Saga – An elevator programming game

#106
post #54

Earlier quoted context omitted.

I believe some people really need think in term of comparations and, for those, adding a "==" symbol make sense, even if the resultant code doesn't make any sense at all!! Also, I can never understand why people write .. if (foo()) { return true; } else { return false; } .. or things like extra parens on conditionals, or weird styles like: return (false); I strongly believe people write as they talk, and talk as they…

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; }

In an imperative language, you still might want an optional return to jump out of the middle of some code.

Re: Elevator Saga – An elevator programming game

#107
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…

That is unnecessary verbosity. Try this instead:

    bool r = !test();

Re: Elevator Saga – An elevator programming game

#108
post #31

Earlier quoted context omitted.

Guess, I got lucky, haha. I should probably go back to challenge 2 and learn how to program these then.

On six it takes you back to 4 floors with 2 elevators and the challenge is 40 people in under 60 elevator moves. The first 5 are easy to "brute force" but six is making me think a bit more.

I cheated with #6. My elevators wait on the ground floor until they fill up, then they deliver the patrons to their floors. Everyone not on the ground floor... is stuck forever.
Post reply on HN