ruby-warrior icon indicating copy to clipboard operation
ruby-warrior copied to clipboard

warrior.look returns wall for stairs?

Open meesterdude opened this issue 12 years ago • 5 comments

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.

meesterdude avatar Jan 21 '12 16:01 meesterdude

Does warrior.feel.stairs? not work for you? That should return true/false depending on if there are stairs on that space.

ryanb avatar Apr 28 '12 23:04 ryanb

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.

meesterdude avatar Apr 29 '12 00:04 meesterdude

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.

ronald avatar Sep 24 '13 15:09 ronald

Stairs should really be another case, and not a sub of wall. This code should be refactored

ghost avatar Jul 26 '15 18:07 ghost

You volunteering?

bf4 avatar Jul 26 '15 23:07 bf4