ruby-warrior
ruby-warrior copied to clipboard
warrior.look returns wall for stairs?
Maybe I don't understand the grander dynamics yet of the game, but, shouldn't our warrior be able to see stairs? He can warrior.feel stairs, and the stairs are a distinct icon on the map like everything else, but he can't see them? I'm a little puzzled by that.
Does warrior.feel.stairs?
not work for you? That should return true/false depending on if there are stairs on that space.
warrior.feel.stairs?
does work. My question was why does the warrior see a wall where there are stairs? From what I recall I had cleared out the room of bad dudes and wanted the warrior to just walk forward if he saw stairs in front of him.
Problem exists when using Strings.
@ > |
---|
p w.look.map(&:to_s) => ["nothing", "nothing", "wall"] p w.look.map(&:stairs?) => [false, true, false]
Perhaps https://github.com/ryanb/ruby-warrior/blob/master/lib/ruby_warrior/space.rb#L61 needs a special case for stairs.
Stairs should really be another case, and not a sub of wall. This code should be refactored
You volunteering?