[Robotgroup] Basic Stamp RANDOM

Andre Lamothe ceo at nurve.net
Wed May 21 16:34:53 PDT 2008


Kevin,

In general all software random number generators use a pseudo random 
sequence generator based on a a feedback loop in software. Thus when you 
reset the computer, ask for a random number you will ALWAYS get the same 
ones in the same sequence. Now, the other problem you might have is that you 
didn't "seed" the random number generator, I don't play with stamps, but in 
most cases with any library there is a seed random that allows you to start 
the generator off with a number of your choice, so you can get some modicum 
of different sequences, typically people will seed this with the time, or a 
pin sample, or just when the user hits a button, a counter is used as the 
seed.

So things to look for are "seed" function, make sure you are doing that. And 
also make sure you are reading the value back, I think on the stamps they 
return an int for the rand function. So you should have to do any scaling.

Andre'



----- Original Message ----- 
From: "Kevin Booth" <kevin.c.booth at gmail.com>
To: <robotgroup at puremagic.com>
Sent: Wednesday, May 21, 2008 5:50 PM
Subject: [Robotgroup] Basic Stamp RANDOM


Is there anyway to get around the non-randomness of the RANDOM statement?
Currently every time i use it i get the same result.

Please help =D

-Kevin Booth
_______________________________________________
Robotgroup mailing list
Robotgroup at puremagic.com
http://lists.puremagic.com/cgi-bin/mailman/listinfo/robotgroup 



More information about the Robotgroup mailing list