On Tue, Mar 4, 2008 at 8:50 AM, August0866 <august0866 / hotmail.com> wrote:
> OK, 2 dumb questions What is the difference between a class and a
>  module and
>
>  What is wrong here, the logic or the syntax
>
>  <stub location =( class => Npc, def => job)>
>
>   def job
>        if
>          @power.to_f > 12 && @smarts.to_f > 14 && @speed.to_f > 14
>          @job = 'Adventurer'
>     elsif
>       @power.to_f > 14 and (@smarts.to_f <14 or @speed.to_f < 14)
>         @job = 'laborer'
>     elsif
>         @power.to_f < 14 and (@smarts.to_f > 14 and @speed.to_f > 14)
>         @job = 'coureror'
>     elsif
>         @power.to_f < 14 and (@smarts.to_f > 14 and @speed.to_f < 14)
>         @job='teacher'
>     else
>         @job = 'commoner'
>     end
>  end
>  </stub>
>
>  the result is sometimes joe is an adventurer otherwise nothing is
>  output

Not sure, but I think the logic.  (@smarts.to_f < 14 or @speed.to_f <
14) will be true the same time (@smarts.to_f > 14 and @speed.to_f <
14) is true.  Your decision set is not mutually exclusive because of
that first 12 (What if your 13?).  Just a guess...

Todd