Curiosity : RandomSeed(Random(1000))

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
SPH
Enthusiast
Enthusiast
Posts: 596
Joined: Tue Jan 04, 2011 6:21 pm

Curiosity : RandomSeed(Random(1000))

Post by SPH »

Curiosity:

Code: Select all

RandomSeed(Random(1000))
Debug Random(1000)
:twisted: :wink:

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 488
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Curiosity : RandomSeed(Random(1000))

Post by Mindphazer »

So, what ?
MacBook Pro 16" M4 Pro - 24 Gb - MacOS 15.4.1 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
User avatar
SPH
Enthusiast
Enthusiast
Posts: 596
Joined: Tue Jan 04, 2011 6:21 pm

Re: Curiosity : RandomSeed(Random(1000))

Post by SPH »

And so: asking PB to create a random RandomSeed when it shouldn't, I find that comical. :shock: :D

!i!i!i!i!i!i!i!i!i!
!i!i!i!i!i!i!
!i!i!i!
//// Informations ////
Portable LENOVO ideapad 110-17ACL 64 bits
Version de PB : 6.12LTS - 64 bits
User avatar
Piero
Addict
Addict
Posts: 1044
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Curiosity : RandomSeed(Random(1000))

Post by Piero »

Huh?
Do you (always) get a weird result (like 1000)?
Not here on ARM Mac…
¿ random RandomSeed when it shouldn't ?
User avatar
mk-soft
Always Here
Always Here
Posts: 6324
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Curiosity : RandomSeed(Random(1000))

Post by mk-soft »

Doesn't make sense.

Random always starts at program start randomly
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Curiosity : RandomSeed(Random(1000))

Post by DarkDragon »

Pseudo random number generators (PRNGs) are state machines and the seed sets that state. You're setting the state randomly based on the previous random state. Some PRNG algorithms use the previous random number directly as state.
bye,
Daniel
User avatar
Piero
Addict
Addict
Posts: 1044
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Curiosity : RandomSeed(Random(1000))

Post by Piero »

I heard many times about getting a Random "random SEED"… (e.g., to then extract lottery numbers…)
Stupid example I just invented now: you can use the luminosity of a flame being gently blown by a fan…
…or the movements of your mouse…
…or………

…Isn't that WEIRD?

………I find "randomness" to be very fascinating, like "infinity"…
I must stop here, or Olli will say I'm posting religious stuff :)
User avatar
Demivec
Addict
Addict
Posts: 4282
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Curiosity : RandomSeed(Random(1000))

Post by Demivec »

Piero wrote: Wed Oct 29, 2025 3:51 pm I heard many times about getting a Random "random SEED"… (e.g., to then extract lottery numbers…)
Stupid example I just invented now: you can use the luminosity of a flame being gently blown by a fan…
…or the movements of your mouse…
…or………

…Isn't that WEIRD?

………I find "randomness" to be very fascinating, like "infinity"…

Even those things you mentioned are predictable if given enough information (and time). The only attribute you need to concern yourself with is whether they are random enough or if their randomness is comparable to the process you are trying to mimic.
User avatar
Piero
Addict
Addict
Posts: 1044
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Curiosity : RandomSeed(Random(1000))

Post by Piero »

Demivec wrote: Wed Oct 29, 2025 4:01 pmThe only attribute you need to concern yourself with is whether they are random enough or if their randomness is comparable to the process you are trying to mimic.
Thanks Demivec; that's real Science! (Although much more limited than most ppl think)

PS: hmmm… are you really sure the flame luminosity is predictable? ;P
User avatar
jacdelad
Addict
Addict
Posts: 2033
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: Curiosity : RandomSeed(Random(1000))

Post by jacdelad »

Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
NicTheQuick
Addict
Addict
Posts: 1529
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Curiosity : RandomSeed(Random(1000))

Post by NicTheQuick »

If you need real randomness use `CryptRandom()`. It creates cryptographic secure randomness.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Post Reply