Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Randomize not very random?
#3
It is exactly as @Zoran commented. You should use RANDOMIZE only once in your program.
If you put it at the beginning of your program, since you're using an emulator and RANDOMIZE relies on timer FRAMES counter to initialize the seed, it will initialize always to the same seed, yielding always the same number sequence.

For a truly "random" seeding, you need an external "random" source, such as user input.
If you ask the user to PRESS a KEY to continue (PAUSE 0), or just use RANDOMIZE after the user press KEY to start the game, then it should work. In this case, you will call RANDOMIZE every time the game is about to start, but it's ok: it will be a differen timer count :-)
---
Boriel
Reply


Messages In This Thread
Randomize not very random? - by BrianT - 04-06-2025, 12:21 PM
RE: Randomize not very random? - by Zoran - 04-06-2025, 01:26 PM
RE: Randomize not very random? - by boriel - 04-06-2025, 07:07 PM
RE: Randomize not very random? - by BrianT - 04-06-2025, 08:35 PM
RE: Randomize not very random? - by Zoran - 04-08-2025, 10:40 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)