This is brilliant. Do you know of other games like this?
www.checkio.org - Looks more like a game, but the programming environment feels more "in-your-face" than elevator saga to me.
51–60 of 108 posts
This is brilliant. Do you know of other games like this?
www.checkio.org - Looks more like a game, but the programming environment feels more "in-your-face" than elevator saga to me.
{init:function(){world.transportedCounter=999999},update:eval}
My attempt at a basic smart algorithm. Not so easy... https://gist.github.com/kballenegger/e275a99d50de2ee07f97
side note: why are you using underscore? I wanted to try your code, but doesn't work out-of-the-box.
My attempt at a basic smart algorithm. Not so easy... https://gist.github.com/kballenegger/e275a99d50de2ee07f97
Why do you have conditionals written like this: if (elevator.goingUpIndicator() == true)? Why not just: if (elevator.goingUpIndicator())?
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 think; which not clearly translates linearly when what you write is code ;)Earlier quoted context omitted.
Why do you have conditionals written like this: if (elevator.goingUpIndicator() == true)? Why not just: if (elevator.goingUpIndicator())?
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…
e.g.
int foo(int x) { bar(x,y); }
or x = {if (foo() > 9) true; else false; }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; }
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; }
I wonder how much more efficient you could be, if people didn't just call for going up/down, but their destination floor.