News for hackers. Stuff that matters.
Re:So You Think You Can Program an Elevator by noir_lord on Tuesday January 12, 2016 @03:46PM (#10890249)
Very similar immediately playable JavaScript version.

http://play.elevatorsaga.com/

Which I'm now closing as I lost too much time to this the first time I saw it.

Re:So You Think You Can Program an Elevator by Cshelton on Tuesday January 12, 2016 @04:43PM (#10890630)
This is awesome, I'm closing it now though as well.

This is how teaching should be...this exercise isn't at all about programming and more about how to think. This can be simplified into a drag and drop block language and given to grade school kids as a really good exercise.

Many programmers in the professional world today would really struggle with this because they never learned to actually think, they just "program" (copy paste, edit work already done by others). They don't actually create new things or find solutions themselves.

Re:So You Think You Can Program an Elevator by tsunamifury on Tuesday January 12, 2016 @05:10PM (#10890803)
Plenty of programmers think, they just don't consider the use case and the user.
Re:So You Think You Can Program an Elevator by dwd on Wednesday January 13, 2016 @01:53AM (#10892707)
My kids played this first time around, they would have been grade 5 or 6 at the time and got through to level 7 before hacking the level selection and trying random levels to see which ones their approach worked with.
Re:So You Think You Can Program an Elevator by lfowles on Tuesday January 12, 2016 @08:40PM (#10891757)
This would be a great Blockly[0] demo

[0]: https://developers.google.com/blockly/?hl=en

Re:So You Think You Can Program an Elevator by MzHN on Wednesday January 13, 2016 @12:29AM (#10892475)
Indeed. Example of a similar game using Blockly, with the option to switch to JavaScript:

http://slushsmackdown.com

Re:So You Think You Can Program an Elevator by kilroy123 on Tuesday January 12, 2016 @07:24PM (#10891454)
This is fantastic. Are there other good programming challenge / games like this? I'd love to see a collection of other similar games.
Re:So You Think You Can Program an Elevator by lackbeard on Tuesday January 12, 2016 @10:49PM (#10892211)
Re:So You Think You Can Program an Elevator by darylteo on Tuesday January 12, 2016 @07:33PM (#10891491)
https://codecombat.com/ maybe?

http://www.codeandconquer.co/ is vaporware at this stage.

https://www.battlecode.org/ is also great fun each year. Not sure if it continues running after the competition is over.

http://aichallenge.org/ hasn't run either for awhile unfortunately.

Re:So You Think You Can Program an Elevator by jhoffner on Wednesday January 13, 2016 @03:12AM (#10892954)
Check out http://www.CodeWars.com

It's the best one for doing challenges that use actual test cases. This challenge could easily be ported to that site (and I think there already are a few elevator ones)

Re:So You Think You Can Program an Elevator by Kurtz79 on Wednesday January 13, 2016 @05:28AM (#10893407)
"Human Resources Machine" from Tomorrow Corporation (it's a proper indie game, you can find it on Steam).

It abstracts simple programming concepts (like loops, branches, etc) in a visual language.

Re:So You Think You Can Program an Elevator by krock on Tuesday January 12, 2016 @08:21PM (#10891683)
ruby warrior https://www.bloc.io/ruby-warrior is another good one
Re:So You Think You Can Program an Elevator by jvolkman on Tuesday January 12, 2016 @09:24PM (#10891959)
Robocode is another one: http://robocode.sourceforge.net/
Re:So You Think You Can Program an Elevator by kiliankoe on Friday January 15, 2016 @10:38AM (#10909878)
I spent way too much time with Robocode a few years back. Those advanced "surfing" bots some people built though... It was quite disheartening having not the slightest bit of a chance as a novice programmer.
Re:So You Think You Can Program an Elevator by hodwik on Tuesday January 12, 2016 @09:35PM (#10891987)
Stockfighter.io and microcorruption
Re:So You Think You Can Program an Elevator by mshang0 on Tuesday January 12, 2016 @06:57PM (#10891340)
This game is basically what I set out to make, not knowing it existed at the time.
Re:So You Think You Can Program an Elevator by hodwik on Tuesday January 12, 2016 @04:03PM (#10890379)
Oh no. My work day has been seriously threatened.
Re:So You Think You Can Program an Elevator by noir_lord on Tuesday January 12, 2016 @04:08PM (#10890413)
Which is why I closed it once I'd copied the link, it's very very addictive.

I think it's the programmer equivalent of https://xkcd.com/356/

Re:So You Think You Can Program an Elevator by Luyt on Wednesday January 13, 2016 @04:05AM (#10893131)
Nice link! The problem has been solved, by the way: http://physics.stackexchange.com/questions/2072/on-this-infi...
Re:So You Think You Can Program an Elevator by kevindeasis on Tuesday January 12, 2016 @04:08PM (#10890411)
That is hilarious. If elevators always malfunctioned like that imagine how many calories some people would burn.
Re:So You Think You Can Program an Elevator by logn on Tuesday January 12, 2016 @11:40PM (#10892352)
This makes me want a hackable version of SimTower.
Re:So You Think You Can Program an Elevator by keville on Tuesday January 12, 2016 @06:24PM (#10891202)
Also came here to post this link. Ought to come with a warning label.
Re:So You Think You Can Program an Elevator by nitin_flanker on Wednesday January 13, 2016 @12:14AM (#10892436)
I stuck at challenge #10, can anybody help?
Re:So You Think You Can Program an Elevator by emonidi on Wednesday January 13, 2016 @03:36PM (#10897291)
I am also stuck at number ten. There is a link "Wiki and solutions" in which I guess we could find some useful theory. Still haven't taken a look at it.
Re:So You Think You Can Program an Elevator by oliv__ on Tuesday January 12, 2016 @04:35PM (#10890564)
This is fun! Thanks for sharing.
Re:So You Think You Can Program an Elevator by Already__Taken on Wednesday January 13, 2016 @04:59AM (#10893297)
Well I can report just straight random is only good enough for the first level.
Re:So You Think You Can Program an Elevator by est on Wednesday January 13, 2016 @12:43AM (#10892513)
Somehow I find this API counter-intuitive and painful to use.

- Why currentFloor() is a function not a property?

- Why both goingUpIndicator() and goingDownIndicator() instead of .direction property?

- Why name destinationDirection() instead of currentDirection?

- Why only floor_button_pressed but no in-door button press event?

I gave up.

Re:So You Think You Can Program an Elevator by emonidi on Wednesday January 13, 2016 @03:31PM (#10897248)
1. Because maybe the author wanted to keep the property hidden and only expose a getter function and hide the setter? 2. Same reason. They are being set internally. A sane programmer would not give you the power to do that because its a product of internal calculations. 3. Naming of method/function and variables is the second hardest thing in programming :) 4. The callback of on.('floor_button_pressed') gives you an floorNumber argument which is more than sufficient. What event in real life would you describe with on('in-droor-button-press') ?
Re:So You Think You Can Program an Elevator by digi_owl on Wednesday January 13, 2016 @03:40AM (#10893053)
What i found the most annoying was that it had both a save and a apply button.

Hilariously i missed the apply button on the first try, and wondered why it was still only moving between 0 and 1 after adding a few lines.

The site design could do with a tuneup as well. The actual page seems to only fit on widescreen, while the docs page becomes painful to read on same.

Re:So You Think You Can Program an Elevator by mschuster91 on Tuesday January 12, 2016 @04:53PM (#10890708)
Is there a solution "Attach R2D2 to computer terminal"? ;)