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 Discussion / Randomize command

Author
Message
Donald Smith
22
Years of Service
User Offline
Joined: 15th Nov 2002
Location:
Posted: 29th Oct 2003 01:16 Edited at: 29th Oct 2003 01:33
I'm making a Concentration game where the Randomize command is choosing 12 of 65 various prizes. Once the prizes are chosen, they're put behind numbered tiles.

I'm also using the RND command to place the "randomly" chosen prizes behind "randomly" chosen numbered tiles?

When I restart the program after debugging, every three puzzles or so are repeated, meaning the same prizes are behind the same numbered tiles.

How can I make the Randomize really random?

Thanks
ESC_
21
Years of Service
User Offline
Joined: 29th Aug 2003
Location: Mass.
Posted: 29th Oct 2003 02:16
Since the computer is unable to generate truely random numbers, the trick most commonly use is to seed the generator with the system timer, like so:
randomize timer()

"That's not a bug, it's a feature!"
"Variables won't, constants aren't."

Login to post a reply

Server time is: 2025-05-21 09:36:18
Your offset time is: 2025-05-21 09:36:18