public final class RobotMath extends Object
When robot classes are loaded, calls to Math.random() and StrictMath.random() are replaced with
calls to random(), which uses the random number generator of Robocode. With Java 8, Robocode replaced the
random number generator of the Math class instead, but this is not possible with newer Java versions.
Robots should not use this class directly.
| Modifier and Type | Method and Description |
|---|---|
static double |
random()
Returns a random number like
Math.random(), but from the random number generator of Robocode. |
public static double random()
Math.random(), but from the random number generator of Robocode.Copyright © 2001-2026 Robocode. All Rights Reserved.