[Home] [Groups] - Message: [Prev in Group] [Next in Group]

nu.kanga.list.mud-dev

651: Re: [MUD-Dev] The laws of probability

[Full Header] [Plain Text]
From: coder@ibm.net
Newsgroups: nu.kanga.list.mud-dev
Date: Tue, 10 Jun 97 20:13:39 -0700
References: [1]
Organization: Kanga.Nu
On 08/06/97 at 10:32 AM, cg@ami-cg.GraySage.Edmonton.AB.CA (Chris
Gray) said: >[Chris L. on the laws of probability:]

>:  X is a random number from 0 - MAX_UINT.
>:
>:  Y is the sum of all the char_weight_map entries which match type
>:entries in type_list.
>:
>:  Z is the sum of all the env_weight_map entries which match type
>:entries in type_list.
>:
>:  if (base_probability + Y + Z < X) then
>:    return 1
>:  else
>:    return 0
>:  endif

>Looks pretty good to me! My only comment is that it might be more
>programmer friendly if X ranged from 0 to some multiple of 100, so
>that the Y and Z factors would be easier to get a grasp on - they
>could be percentage values scaled by that same multiple.

Actually its silly to have it 32bits.  A 16bit value would offer more
than fine enough granularity.  The shame is that I don't have an 16bit
values internally.  Conversely I don't think that a simpler percentage
offeres a fine enough granularity.

I'm thinking of making constants available which equate to 1%, 0.1%,
.001% etc so that a weighting factor can be defined as a fractional
percentage without having to get into floating point.

--
J C Lawrence                               Internet: claw@null.net
----------(*)                              Internet: coder@ibm.net
...Honourary Member of Clan McFud -- Teamer's Avenging Monolith...