Skip to content

Rand

Spice
import "std/math/rand";

Functions

randInt

Spice
public f<int> randInt(int min, int max)

Generates a random integer between min and max Note: Both min and max are inclusive: [min, max] Note: If min > max, the function always returns max

Parameters

Name Type Description
min int
max int

Returns: int — Random number