Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / random numbers

Author
Message
kfoong
21
Years of Service
User Offline
Joined: 28th Jan 2003
Location: Australia
Posted: 2nd Apr 2003 15:15
How do i make random numbers? its something to do with the the randomize but i dont know how to use it and the manual doesnt help me.
--------
http://www.stellarblue.vze.com/
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 2nd Apr 2003 17:18
simply type

variable=rnd([Highest Number Wanted])

for example if you type

a=rnd(5)

then "a" will be eather 0,1,2,3,4,or 5... or if you type

number#=rnd(15)

then "number#" will be 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14, or 15... i hope this helps.

Anyone Can Destroy...But Few Can Create...
DangYankee
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: United States
Posted: 2nd Apr 2003 20:00
Again a good post on this was lottery by mark3d, lots of good examples were given.

It's not the size of your code but how efficiently you use it!
Shadow
22
Years of Service
User Offline
Joined: 17th Oct 2002
Location: In the shadows
Posted: 2nd Apr 2003 20:16
Important: Before you use rnd(), use randomize timer() at the start of your program, or the numbers won't be very random.

Login to post a reply

Server time is: 2024-11-24 08:52:15
Your offset time is: 2024-11-24 08:52:15