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
Elevator Saga – An elevator programming game
91–100 of 108 posts
Re: Elevator Saga – An elevator programming game
#92Earlier 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.
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
#93A 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…
Re: Elevator Saga – An elevator programming game
#94Re: Elevator Saga – An elevator programming game
#95Developer 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..…
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
#96As an extra challenge I followed these rules:
1) Elevators cannot inspect the state of other elevators
2) No Hacking the games internal apis
3) No timeout callbacks
Re: Elevator Saga – An elevator programming game
#97Earlier 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…
Re: Elevator Saga – An elevator programming game
#98Earlier 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…
Re: Elevator Saga – An elevator programming game
#99Slightly 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
Re: Elevator Saga – An elevator programming game
#100And here's my solution, not too bad, had lots of fun: https://github.com/tasuk/elevatorsaga-solver