ryanb / ruby-warrior

Game written in Ruby for learning Ruby.
MIT License
3.83k stars 838 forks source link

array returned by warrior.look is string? #48

Open meesterdude opened 12 years ago

meesterdude commented 12 years ago

I'm not sure if this is an issue or a quirk or nothing. The supporting code looks right as far as i can tell.

warrior.look.to_s returns something like [nothing, Wizard, nothing] while ["nothing", "nothing", "nothing"] .to_s returns ["nothing", "nothing", "nothing"]

was trying to do array comparison with 'eql?' and kept getting false returns. though what I don't understand is warrior.look[1] returns the correct item.

I had to create my array like "[nothing, Wizard, nothing]" in order to compare.

So, from what i can tell, isn't the array returned by warrior.look invalid in some way?