random

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Float

func Float(thread *starlark.Thread, fn *starlark.Builtin,
	args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

Float returns a random floating point number r such that 0.0 <= r < 1.0.

Returns: float

func Init

func Init(thread *starlark.Thread, fn *starlark.Builtin,
	args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

Init seeds the pseudo-random number generator.

Arguments:

Arguments:

seed: Optional integer seed for the generator. If not provided, current time is used.

Returns: None

func LoadModule

func LoadModule() starlark.StringDict

LoadModule returns the dictionary of built-in functions for this module.

func RandInt

func RandInt(thread *starlark.Thread, fn *starlark.Builtin,
	args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

RandInt returns a random integer r such that a <= r <= b.

Arguments:

a: Lower bound (inclusive).
b: Upper bound (inclusive).

Returns: int

func RandRange

func RandRange(thread *starlark.Thread, fn *starlark.Builtin,
	args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

RandRange returns a random integer r such that a <= r < b.

Arguments:

a: Lower bound (inclusive).
b: Upper bound (exclusive).

Returns: int

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL