L3DT users' wiki
Large 3D terrain generator

frand

Description

Get a floating point random number, in the range of -1…1.

Function prototype

float frand <void>

Arguments

None.

Return value

A floating-point random number, in the range of -1…1.

Example

// write random number to event log 10 times
int i
set i 0
do
  echo <zs:frand>
  incr i
while <zs:islt i 10>

… the output of which is written to the event log by echo as:

-0.667531
0.32609
-0.0984222
-0.295755
-0.885922
0.215369
0.566637
0.605213
0.0397656
-0.3961

Comments

None.

See also

 
plugins/general/zeoscript/reference/functions/frand.txt · Last modified: 2017/08/31 07:33 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki