Just thought I should point out that this example assume a 7-sided die (with the faces 0 - 6).
I don't think a normal person using that example would think that the die might land on 0
Quick to fix though, change the range to be 0 - 5 and add 1 to the result.
Lowest value: 0 + 1 = 1
Highest value: 5 + 1 = 6
IF Num = rnd(5) + 1
and just to actually show you, run this app
set display mode 1024,768,16
`feel free to change those dimensions
sync on
sync rate 0
sync
for x = 0 to screen width() * 0.95 step 15
for y = 0 to screen height() * 0.95 step 15
RndNum = rnd(6)
if RndNum = 0
ink rgb(255,0,0),1
else
if RndNum = 6
ink rgb(0,255,0),1
else
ink rgb(255,255,255),1
endif
endif
text x,y,str$(RndNum)
next y
next x
sync
suspend for key
end