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.

DarkBASIC Professional Discussion / Why doesn't the rnd() command work in patch 3.1

Author
Message
IceBird
22
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Sweden
Posted: 3rd Feb 2003 15:53
The program always returns the same number everytime the program runs.. for example



Every time I run the program the x# is 2
Whats wrong???
------------------------------------------------
Someone is watching you...... And it isn't ME!
------------------------------------------------
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 3rd Feb 2003 15:54
Put Randomize Timer() at the top of your program.

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Steverino
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 3rd Feb 2003 18:20
A couple years ago I suggested that they mention the use of Timer() in the documentation for the Randomize command. I wonder how many hundreds of redundant forum threads could have been avoided...

Surrealist writing toy -- http://www.iconpoet.com
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 3rd Feb 2003 18:27
Indeed, it would be a good idea, I've answered this same type of question about 5 or 6 times now

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 3rd Feb 2003 18:31
Actually it probably wouldn't save as many as you think - most people don't bother reading before posting here

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Feb 2003 19:03
LOL Too bloody right.
Steverino
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 3rd Feb 2003 19:10
Yeah, but when someone looks up Randomize, chances are they want to know how to get random numbers that are different every time, so why not just tell them? Especially since in some other BASICs, Randomize alone does what Randomize Timer() does in DB.

The goal of documentation should be to help people do what they want to do, not to give just enough hints that the really smart ones can figure it out themselves after reading about all 1000 commands.

Surrealist writing toy -- http://www.iconpoet.com
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 3rd Feb 2003 19:14
You're right too but it wouldn't stop all the posts *sigh* no-win.
Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 3rd Feb 2003 19:33
Steverino - you missed my point, I know it's worth having in the manual - but most people here would still "post first, read manual second".

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
UberTuba
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Brittania
Posted: 3rd Feb 2003 19:54
By the way most people who used qb used the ranomize timer ()
command as well

Life is a terminal disease.
You never survive it.
Andy Igoe
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: United Kingdom
Posted: 4th Feb 2003 01:42
Just before you make any hasty decisions please don't ever remove functionality to generate the same series of random numbers. I use that alot. Fractals forever, man!

Pneumatic

Pneumatic of Xev@EQ
God made the world in 7 days, but we're still waiting for the patch.
Easily Confused
22
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 4th Feb 2003 02:01
Don't worry, they will never do that

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Steverino
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United States
Posted: 4th Feb 2003 16:54
I definitely wasn't suggesting they remove the possibility of using a predictable seed! Just that they add a line to the docs for Randomize specifically mentioning the use of Randomize Timer().

As it stands now, we are denied the pleasure of jeering at them to RTFM!

Surrealist writing toy -- http://www.iconpoet.com

Login to post a reply

Server time is: 2025-05-17 18:34:35
Your offset time is: 2025-05-17 18:34:35