1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>random() function</title> |
5 |
<meta name="description" content="Random number generator function."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>random()</h1> |
9 |
<p> |
10 |
Provides a pseudo random number generator. Each time this function |
11 |
is called, another random number will be returned. |
12 |
</p> |
13 |
|
14 |
<h3>Function Prototype</h3> |
15 |
<p/> |
16 |
<code lang="nksp"> |
17 |
random(??minimum??, ??maximum??) |
18 |
</code> |
19 |
|
20 |
<h3>Arguments</h3> |
21 |
<table> |
22 |
<tr> |
23 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
24 |
</tr> |
25 |
<tr> |
26 |
<td><code>??minimum??</code></td> |
27 |
<td>Integer Number</td> |
28 |
<td>The smallest number of allowed value range (including this value).<br> |
29 |
[required]</td> |
30 |
</tr> |
31 |
<tr> |
32 |
<td><code>??maximum??</code></td> |
33 |
<td>Integer Number</td> |
34 |
<td>The highest number of allowed value range (including this value).<br> |
35 |
[required]</td> |
36 |
</tr> |
37 |
</table> |
38 |
|
39 |
<h3>Return Value</h3> |
40 |
<table> |
41 |
<tr> |
42 |
<th>Description</th> <th>Data Type</th> |
43 |
</tr> |
44 |
<tr> |
45 |
<td>Next random number within the requested value range.</td> |
46 |
<td>Integer Number</td> |
47 |
</tr> |
48 |
</table> |
49 |
|
50 |
<h3>Examples</h3> |
51 |
<p/> |
52 |
<code> |
53 |
on init |
54 |
message("random(-5,5) = " & random(-5,5)) |
55 |
message("random(-5,5) = " & random(-5,5)) |
56 |
message("random(-5,5) = " & random(-5,5)) |
57 |
message("random(-5,5) = " & random(-5,5)) |
58 |
end on |
59 |
</code> |
60 |
|
61 |
</body> |
62 |
</html> |