Re: demon_summon spec_proc

From: Sammy (Samedi@cris.com)
Date: 01/17/97


On Fri, 17 Jan 1997 BuckFloyd@aol.com wrote:

- >   if (number(0,100) > number(0, 100))
- >   {
- >     if ((number(0, 100) < 50) && (number(0, 100) > 85))
- >     {

Wow that really is odd.  To each his or her own, I guess, but it's a
little wasteful of processor time.  I think somoene who's had a statistics
class could break those 4 random numbers down and turn it into one.

This is my take on it:

- >   if (number(0,100) > number(0, 100))

This looks like a 50-50 chance to me, which could be changed to:

  if(number(0, 1))

And add these in:

- >     if ((number(0, 100) < 50) && (number(0, 100) > 85))

Hmm another 50-50, and a %15 chance.  Since these are all and'ed together,
if my wild guess at statistics is correct, you've got a 50/100 + 50/100 +
15/100 chance of getting through all the ifs, or 115/300, or a 38%.  Am I
close?  If so, then you could consolidate all four random number
generators into this one line:

  if(!number(0, 37))

Sam
p.s. Yeah I know my numbers aren't exact, it's the formula I'm wondering
about :P

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST