<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
  SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
  <func>
    <title>Random</title>
    <category>Arithmetics</category>
    <version>5.1 OC</version>
    <syntax>
      <rtype>int</rtype>
      <params>
        <param>
          <type>int</type>
          <name>max</name>
          <desc>Maximum value</desc>
        </param>
      </params>
    </syntax>
    <desc>Yields a random number from 0 to max-1. The returned value cannot be greater than 32767, however.</desc>
    <examples>
      <example>
        <code>protected func Hit()
{
  <funclink>if</funclink>(!Random(60)) <funclink>Explode</funclink>(Random(10)+1);
}
        </code>
        <text>Explodes the object with a probability of 1:60. The explosion radius is a random value from 1 to 10.</text>
      </example>
    </examples>
    <related><funclink>RandomX</funclink></related>
  </func>
  <author>jwk</author><date>2002-06</date>
</funcs>
