From: August0866 Date: 2008-03-05T09:04:54+09:00 Subject: Re: Class and inheritance On Mar 4, 2:35 pm, Todd Benson wrote: > On Tue, Mar 4, 2008 at 12:23 PM, Todd Benson wrote: > > > 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... > > One other thing, though. Maybe you want your code to cascade the > decision like that. In any case, your code works just fine on my > system, as long as I properly #rand my power, smarts, and speed :-) > On 1.8.6, the if/elsif construct seems to correctly jump out. In > other words, if my power is 13, then it will will leave the loop with > the second result and never get to the fourth. > > My distribution for 10_000 people for one run using rand(20 for each > attribute turns out to be... > > adventurer: 211 > laborer: 2260 > courier: 416 > teacher: 1261 > commoner: 5852 > > ..which doesn't look too bad. > > Todd Thanks Todd, how would i go about defining a job and its requirements and then match the npc to the job job[[Adventurer,14,14,14],[Courier,14,10,14] .... ] the numbers are the minimum stats for the job these jobs are actually categories i am going to break them down to specific occupations next