News for hackers. Stuff that matters.
Re:RubyWarrior - Bloc by epidemian on Saturday July 27, 2013 @11:03PM (#6115424)
This should win every level (given enough tries):

  def play_turn(warrior)
    m = warrior.methods.grep(/.!$/).sample
    warrior.send(m, *([nil, :backward].sample if m != :rest!))
  end
(that sucker of :rest! that doesn't accept a direction argument!)

It's kind of amusing to see the warrior do random stuff like shooting arrows backwards and pivoting back in the worst possible moments. Too bad that Run button repeats the same movements if you didn't edit the source code somehow.

Great game and concept BTW!

Re:RubyWarrior - Bloc by matthuggins on Sunday July 28, 2013 @12:58AM (#6115685)
Haha, I didn't play long enough to realize all the methods ended with a bang, this is awesome.
Re:RubyWarrior - Bloc by aperley on Saturday July 27, 2013 @11:09PM (#6115435)
The sandbox probably always initializes with the same random seed.
Re:RubyWarrior - Bloc by epidemian on Saturday July 27, 2013 @11:31PM (#6115469)
No, it seems to be a client-side thing. If no edit was made in the code editor since last run it doesn't make the request to https://www.bloc.io/api/v1/ruby_warrior_players/:id (which seems to be the one that returns the warrior and enemy movements). Repeating the same request in cURL multiple times does return different results.