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.