Project

General

Profile

$r » History » Version 5

Per Amundsen, 02/23/2023 07:25 PM

1 1 Per Amundsen
_Added in 1.9.0_
2
3
*$r(v1,v2)*
4
5
Returns a random number or letter between v1 and v2.
6
7
_Same as [[$rand]]._
8
9 4 Per Amundsen
_See also [[$rands]]._
10
11 1 Per Amundsen
*Parameters*
12
13 3 Per Amundsen
table(ktable).
14
|*Parameter*|*Description*|
15
| v1 | Start number or letter [0-9A-Za-z]. |
16
| v2 | End number or letter [0-9A-Za-z]. |
17 1 Per Amundsen
18 5 Per Amundsen
if v1 and v2 are both numeric, returns random number in that range
19
otherwise returns a character in the range of characters v1 and v2
20
21
valid number range -2^63 through 2^63-1
22
23 1 Per Amundsen
*Example*
24
25
<pre>
26
; Get a random number between 10 and 100.
27
//echo -ag $r(10,100)
28
29
; Get a random letter between g and y.
30
//echo -ag $r(g,y)
31
</pre>