1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<?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>RandomX</title>
<category>Arithmetics</category>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>int</type>
<name>value1</name>
<desc>Range start</desc>
<optional />
</param>
<param>
<type>int</type>
<name>value2</name>
<desc>Range end</desc>
<optional />
</param>
</params>
</syntax>
<desc>Yields a random value from value1 to value2. It does not matter, which limit is greater or less.</desc>
<examples>
<example>
<code><funclink>SetXDir</funclink>(RandomX(-20,+20));</code>
<text>Sets horizontal speed of the object to a random value between -20 and +20.</text>
</example>
<example>
<code><funclink>Message</funclink>("Daniel has %d bread rolls!", RandomX(42,23));</code>
<text>Returns the number of Daniel's random bread rolls. This may be a value from 23 to 42.</text>
</example>
</examples>
<related><funclink>Random</funclink></related>
</func>
<author>flgr</author><date>2002-01</date>
</funcs>
|