07-17-2024, 10:08 PM
Bill consults with me all the time. I gave him just enough string theory to hang himself.
Pete
Pete
Fake News + Phony Politicians = Real Problems
Getting a random number wihout RND.
|
07-17-2024, 10:08 PM
Bill consults with me all the time. I gave him just enough string theory to hang himself.
Pete
Fake News + Phony Politicians = Real Problems
Hi guys, been a few years and I thought I would play my hand in some programming again. So I saw this thread and tried it out.
I will admit I used Chat GPT for some of it, but someone has to learn someway. I changed it a bit also making the user able to choose the highest number and also I added more randomness to it by using the seconds in time$ and then dividing that by 10 and then using that variable to times it by timeSeed. It works pretty good. Probably not as random as RND, but what do you think? Code: (Select All)
08-10-2024, 09:01 AM
(This post was last modified: 08-11-2024, 03:42 AM by JRace.
Edit Reason: corrected spell-check error
)
(08-10-2024, 05:15 AM)SierraKen Wrote: Hi guys, been a few years and I thought I would play my hand in some programming again. So I saw this thread and tried it out. This is very close to a Linear Congruential Generator (LCG) which is basically the formula V = (V*A+C) Mod M. (see: https://en.wikipedia.org/wiki/Linear_con..._generator). On the good side:
BUT:
Often the timer or system clock is used as a startup seed value for the accumulator V ("Randomize Timer"), while the multiplier and modulus were chosen (carefully we hope!) when the function was written and never change. I'm concerned that using the timer to set the multiplier as well could result in random output quality which is sometimes acceptable, sometimes not.
b = b + ...
|
« Next Oldest | Next Newest »
|