Skip to content

RandomState

Narta Xaymar Dirks edited this page Dec 2, 2026 · 1 revision

RandomState BlitzLLVM

RandomState:String random:Int32
Parameter Mode Type Default Description
random In Int32 required The generator.

Returns: The state as hexadecimal digits.

Description

BlitzLLVM This command does not exist in the original Blitz products. BlitzLLVM adds it.

The whole state of a generator of CreateRandom, as hexadecimal digits: 16 for PCG32, 32 for xoshiro128**, 8 for the Blitz engine (the number that RndSeed would give) and 5000 for MT19937. SetRandomState puts it back, so that the generator goes on with the same numbers. Store it in a save game or send it in a network snapshot, and the numbers after loading are the ones that would have come without it.

Differences

  • Not in the originals.

Examples

rng = CreateRandom(0, 2024)
Print RandomState(rng)
saved$ = RandomState(rng)
a = SampleRandom(rng, 1, 1000000)
SetRandomState rng, saved
Print a = SampleRandom(rng, 1, 1000000)
61FB743702AFE8FA
1

Related Commands

CreateRandom BlitzLLVM, FreeRandom BlitzLLVM, SampleRandom BlitzLLVM, SeedRandom BlitzLLVM, SetRandomState BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally