From: Benoit Daloze Date: 2010-04-10T22:28:29+09:00 Subject: Re: Ruby-warrior : Teaching AI concepts with Ruby --00163642685b0c6c7a0483e1e3fa Content-Type: text/plain; charset=ISO-8859-1 On 10 April 2010 12:56, Philip Rhoades wrote: > Guys, > > I just used something simple above because the example stuff gave me the > same problem - that is, using: > > > class Player > def play_turn(warrior) > if warrior.feel.enemy? > warrior.attack! > else > warrior.walk! > end > end > end > > results in: > > > Welcome to Ruby Warrior > [1] p - beginner - level 1 - score 0 > [2] New Profile > Choose profile by typing the number: 1 > Starting Level 1 > - turn 1 - > -------- > |@ >| > -------- > ./rubywarrior/p-beginner/player.rb:3:in `play_turn': undefined method > `feel' for # > (NoMethodError) > > Not something I was expecting from something that is supposed to help teach > Ruby . . Well, what do you have in front of you? nothing, so you just need to warrior.walk! You'll get the feel method later, you don't need it yet as there is no enemy. (enemies will be shown on the map) B.D. --00163642685b0c6c7a0483e1e3fa--