From: Ryan Davis Date: 2010-04-10T17:11:01+09:00 Subject: Re: Ruby-warrior : Teaching AI concepts with Ruby On Apr 9, 2010, at 23:38 , Philip Rhoades wrote: > People, > > > On 2010-04-10 05:35, H- 16 wrote: >> Bill Kelly wrote: >> Aldric Giacomoni wrote: >>> I think this project doesn't get enough attention :-) >>> http://github.com/ryanb/ruby-warrior >> >> Oh, definately, this is probably the best way to teach programing. > > > I tried cloning the latest git but adding > > warrior.rest! > > to player.rb and running gave: > ... > ./rubywarrior/p-beginner/player.rb:3:in `play_turn': undefined method `rest!' for # (NoMethodError) > from /usr/lib/ruby/gems/1.8/gems/ruby-warrior/bin/../lib/ruby_warrior/units/warrior.rb:12:in `play_turn' > ... > What have I missed? I dunno as I haven't played with the code yet, but you're calling rest! on a Turn, not on the Warrior. Make sure your warrior variable (or method call result?) is what you think it is. Make sure you still have something like: class Player def play_turn(warrior)