39 lines
1.2 KiB
HTML
39 lines
1.2 KiB
HTML
<html>
|
|
<head>
|
|
<title>Blitz3D Docs</title>
|
|
<link rel=stylesheet href=../css/commands.css type=text/css>
|
|
</head>
|
|
<body>
|
|
<h1>Rnd (start#,end#)</h1>
|
|
<h1>Parameters</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
start# = Lowest value to generate
|
|
<br />
|
|
end# = Highest value to generate
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1>Description</h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
This returns either a floating point or integer number of a random value falling between the start and end number. It returns an integer if assiged to an integer variable, and it returns a floating point value if assiged to a floating number variable. The start and end values are inclusive. Be sure to use the SeedRnd command to avoid generating the same random numbers every time the program is run.
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h1><a href=../2d_examples/Rnd.bb>Example</a></h1>
|
|
<table>
|
|
<tr>
|
|
<td>
|
|
y=Rnd(0,10) ; Set y to a random integer between 0 and 10
|
|
<br />
|
|
y#=Rnd(0,5) ; Set y floating value between 0.000000 and 5.000000
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<br>
|
|
<a target=_top href=../index.htm>Index</a><br>
|
|
<br>
|
|
Click <a href=http://www.blitzbasic.co.nz/b3ddocs/command.php?name=Rnd&ref=comments target=_blank>here</a> to view the latest version of this page online</body>
|
|
</html>
|