<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="GEN42">
  <refmeta>
    <refentrytitle>GEN42</refentrytitle>
  </refmeta>

  <refnamediv>
    <refname>GEN42</refname>
    <refpurpose>
      Generates a random distribution of discrete ranges of values.
      <indexterm id="IndexGEN42"><primary>GEN42</primary></indexterm>
    </refpurpose>
  </refnamediv>
  
  <refsect1>
    <title>Description</title>
    <para>
      Generates a random distribution function of discrete ranges of values by giving a list of groups of three numbers.
    </para>
  </refsect1>

  <refsect1>
    <title>Syntax</title>
    <synopsis><command>f</command> # time size -42  min1 max1 prob1 min2 max2 prob2 min3 max3 prob3 ...  minN maxN probN</synopsis>
  </refsect1>

  <refsect1>
    <title>Performance</title>
    <para>
      The first number of each group is a the minimum value of the first range, the second is the maximum value and the third is the probability of that an element belonging to that range of values can be chosen by a random algorithm. Even if any number can be assigned to the probability element of each group, it is suggested to give it a percent value, in order to make it clearer to the user.
    </para>

    <para>
      This subroutine is designed to be used together with duserrnd and <link linkend="urd"><citetitle>urd</citetitle></link> opcodes (see <link linkend="duserrnd">duserrnd</link> for more information). Since both duserrnd and urd do not use any interpolation, it is suggested to give a size reasonably big.
    </para>
  </refsect1>

  <refsect1>
    <title>Credits</title>
    <para>Author: &namegabriel;</para>
  </refsect1>
</refentry>
