Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

My attempt at Level 1:

  class Player
    def play_turn(warrior)
      warrior.walk!(:right)
    end
  end
The warrior keeps bumping in to a wall, and the code fails.

This is counter-intuitive, because the exit is to the right of the warrior. I can't endure another N levels of nonintuitive frustration, sorry.



actually the warrior starts facing right (which is not specified but could be supposed). so :right is actually moving down, since all movements are relative, which is inferred by :forward and :backward being present and :up :down missing, which I suppose would rather be :north :south :east and :west. Once you also understand that tips really are not, but the necessary API doc, well, it's smooth sailing.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: