ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:randsign

Table of Contents

randsign

int randsign()

Description

Returns a random sign (-1 or 1). Shorthand for 2 * Random(0, 1) - 1.

Examples

int speed = randsign() * 10.0;
// speed is now either 10.0 or -10.0.
functions/randsign.txt · Last modified: 2017/07/09 17:43 by korshun