5 ms·
Ruby programming challenge as job application
- dpritchett 15y agoTo submit a job application, please fork this repository and commit your entry in the programming challenge. Then send us a pull request [on github] with a comment that says you’re looking for a job. Unless I misread this the challenge is only available for people who are publicly job hunting, which is a small percentage of eligible coders. I believe I've seen this before as "tweet us your resume".
- reedlaw 15y agoGood point. We got the idea for this challenge from this: http://www.chrisstucchio.com/blog/2012/one_hiring_filter_that_works.html http://www.chrisstucchio.com/blog/2012/one_hiring_filter_tha... We debated how to implement this and decided on using github because of the added bonus of being able to view github profiles as part of the screening process. If anyone's interested in a job but doesn't want to submit a public pull request, please send your contest submission to reed@smashingboxes.com and let us know if you want your code to be committed to our repo or not.
- dpritchett 15y agoThe problem sounds super fun. I spent an evening in Ruby Warrior [1] just for the fun of it a few months back and your challenge seems like it might be an even more fun version of that. I'm sure you'll get some good submissions. [1] https://github.com/ryanb/ruby-warrior https://github.com/ryanb/ruby-warrior
- reedlaw 15y agoYes, ruby-warrior was an inspiration. The challenge is just a bare minimal RPG at the moment, but I hope to find time to improve it. To-dos: https://github.com/reedlaw/ruby-mmo/wiki https://github.com/reedlaw/ruby-mmo/wiki
- cheald 15y agoIf the purpose of the challenge is to win by showing off your knowledge of Ruby... module Wizard def move; [:rest] end def stats; i = 1.0/0; { health: i, level: i, strength: i, defense: i, experience: i } end def suffer_damage(p); end def to_s; "Zhormenheimer the Illusionist" end end Zhormenheimer the Illusionist: {:health=>Infinity, :level=>Infinity, :strength=>Infinity, :defense=>Infinity, :experience=>Infinity} Zhormenheimer the Illusionist is the winner! (Ruby really needs something like Lua's setfenv!)
- reedlaw 15y agoNice hack. Yes, this is not cheat proof by any means. But Ruby is by its nature hard to prevent someone from doing whatever they want. I did try to make it semi-cheat proof by using a delegator PlayerProxy that sends method calls to the real Player objects. But if you're going to read the stats of other players you must be able to call Player#stats somehow.
- cheald 15y agoIt might be worth defining some boundary conditions on what constitutes a valid player. "May not touch any other game classes/modules, except for this whitelist of methods" and "may not reimplement these methods" is a good start. As-is, there is so little direction that I'd argue that my player is valid per the letter of the rules. :P Without those constraints, there are limitless ways to cheat, especially since it's impossible to actually hide functionality in ruby (obligatory: https://github.com/fxn/i-told-you-it-was-private https://github.com/fxn/i-told-you-it-was-private ), so you have to have a set of meta-constraints in place. Regarding proxying, why not just use the Forwardable module? Though, even if you did manage to hide the critical pieces from the Player, I'd just iterate ObjectSpace to find a PlayerProxy that contains a reference to my Player. :P
- reedlaw 15y agoYou're right, but for me another challenge was to try to circumvent cheating. If I see players that try to win by pure Ruby hackery I'd like to see if there's a Ruby way to make sure that hackery doesn't work (inside Game, Player, or PlayerProxy). Is there a way in Ruby to prevent a module from overriding a method of the class in which its included?
- borlak 15y agothe only winning move is not to play
- hamburglar 15y agoYeah, this has Kobayashi Maru written all over it.
- nmjordan 15y agogood luck !
- QuarkSpark 15y agoThe current fork status indicates 52 unemployed Rubyists?!!