From: Todd Benson Date: 2008-03-05T04:35:24+09:00 Subject: Re: Class and inheritance 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