Skip to content
Narta Xaymar Dirks edited this page Oct 28, 2026 · 7 revisions

Blitz3DBlitzPlusBlitzBasic

Rand

Rand:Int32 from:Int32, to:Int32=1
Parameter Mode Type Default Description
from In Int32 required Lowest result, or the highest when to is left out.
to In Int32 1 Highest result. Defaults to 1.

Returns: A random integer in the range.

Description

Returns a random whole number from from to to, both included. With one argument the range is 1 up to that number. The same seed (see SeedRnd) always gives the same sequence.

Examples

SeedRnd 1234
dice = Rand(1, 6)
Print dice >= 1 And dice <= 6
Print Rand(5, 5)
1
5

Related Commands

Rnd, RndSeed

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally