Skip to content

SetRandomState

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

SetRandomState BlitzLLVM

SetRandomState:Void random:Int32, state:String
Parameter Mode Type Default Description
random In Int32 required The generator.
state In String required The hexadecimal digits from RandomState.

Description

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

Puts a state that RandomState gave back into a generator of CreateRandom. The state can come from another generator, another run of the program or another system: the numbers that follow are the same. Upper and lower case digits both work. The generator has to run the same engine as the one the state came from: anything else than what RandomState gives for that engine stops the program with an error.

Differences

  • Not in the originals.

Examples

a = CreateRandom(0, 1)
b = CreateRandom(0, 2)
SetRandomState b, RandomState(a)
Print SampleRandom(a, 1, 1000000) = SampleRandom(b, 1, 1000000)
1

Related Commands

CreateRandom BlitzLLVM, FreeRandom BlitzLLVM, RandomState BlitzLLVM, SampleRandom BlitzLLVM, SeedRandom BlitzLLVM

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally