From: akraynov Date: 2010-04-16T05:00:59+09:00 Subject: Re: Ruby-warrior : Teaching AI concepts with Ruby Hello guys! I consider RubyWarrior may be useful for learning. A have reached for 6'th level (as beginner). Now my code looks as following: http://good.net/_5pJ5Rurvz . I can't understand issue: if i call in method: def roam_to_combat! debug("Entering roam_to_combat") state = :ws_combat @ini_health = health debug(@ini_health) warrior.attack!(cur_dir) end then it lacks to execute string "state = :ws_combat". But if i call def roam_to_combat! debug("Entering roam_to_combat") self.state = :ws_combat # <-- here is difference @ini_health = health debug(@ini_health) warrior.attack!(cur_dir) end then it executes "state = :ws_combat" normally. Why it didn't execute "state =" without "self"? Is it Ruby's bug? I got Ruby 1.8 installed.