ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:randsign

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
functions:randsign [2017/07/09 17:42] – created korshunfunctions:randsign [2017/07/09 17:43] (current) korshun
Line 4: Line 4:
  
 ===== Description ===== ===== Description =====
-Returns a random sign (''-1'' or ''1'). Shorthand for ''2 * Random(0, 1) - 1''.+Returns a random sign (''-1'' or ''1''). Shorthand for ''2 * Random(0, 1) - 1''.
  
 ===== Examples ===== ===== Examples =====
 <code> <code>
 int speed = randsign() * 10.0; int speed = randsign() * 10.0;
 +// speed is now either 10.0 or -10.0.
 </code> </code>
functions/randsign.1499611375.txt.gz · Last modified: 2017/07/09 17:42 by korshun