Random Numbers - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: QbasicNews.Com (http://qbasicnews.com/newforum/forum-3.html) +--- Forum: Challenges (http://qbasicnews.com/newforum/forum-10.html) +--- Thread: Random Numbers (/thread-757.html) |
Random Numbers - whitetiger0990 - 05-03-2003 Make a random number generator that doesn't use RND... Have Fun! Random Numbers - na_th_an - 05-03-2003 Crappy but working Code: DECLARE FUNCTION MyRandom% (Bottom%, Top%) Random Numbers - whitetiger0990 - 05-03-2003 Interesting... but it is a pattern. If you could make it start in the a different place that would be cool. Random Numbers - Plasma - 05-03-2003 Code: DEFLNG A-Z (QBNews, Volume 2, Number 1 - February 28, 1991) Random Numbers - Agamemnus - 05-03-2003 Given a certain sequence of numbers [S], it has so far been difficult to create another two sequences [S1] and [S2] that represent the first sequence and a decoder with C being at its maximum in: length[S] = length[S1] + length[S2] + C Another difficult problem would be to find a sequence [S]. where sequence [S1a] and decoder [S2a] are the only two possible solutions to length[S] = length[S1] + length[S2] + C. So, making a "true" random number sequence (one without any pattern) is really hard if not impossible. :") Random Numbers - whitetiger0990 - 05-03-2003 I think Plasma357's works! Edit: Heres one that picks a number 1 through 100... Code: CLS Random Numbers - Hexadecimal Disaster - 05-03-2003 Quote:So, making a "true" random number sequence (one without any pattern) is really hard if not impossible. :") Don't crack your head, RND uses patterns too. At least in QB. Random Numbers - DrV - 05-04-2003 I hear that nuclear decay can produce true random numbers somehow... anybody got a nuke in their backyard? Just hook it up to a COM port and write a QB app... :wink: Random Numbers - relsoft - 05-05-2003 Quote:I hear that nuclear decay can produce true random numbers somehow... anybody got a nuke in their backyard? Just hook it up to a COM port and write a QB app... :wink: Nope. Nuclear decay means in itself a patterned decay. ie: Val=Val-Val/2 BTW, val would be you elemental lifespan. Find "HalfLife" in the dictionary. Random Numbers - DrV - 05-06-2003 Whoops... radioactive decay, not nuke. see http://www.nea.fr/abs/html/nesc0843.html |