simulator randoms

redpawn

New Member
The simulator is great addition to the picaxe programming environment. Thanks for including it along with the new commands.
I wrote a program to play Simon using an 08M and a multiplexer to have 4 buttons 4 LEDs along with sound. I found that the random numbers were not too random. I use button time down to randomize my starting seed. Then the seed generates the sequence for game play.
By using sertxd to send the output of Random w0 to a terminal it appears that random w0 generates its random number by multiplying the seed (w0) by 2 then adding 1 using some rule. Not a big deal for game play but far from random.
The basic simulator though generates different random numbers. Only the lower byte of w0 changes and putting an initial value into w0 to act as a seed does not generate the same output from run to run.
Could the simulator be changed to act more like the actual chip when using the random function?
 
Top