Board Thread:Suggestions and Ideas/@comment-26059560-20150627153827

so I was reading up on how computer scientists generate "random" numbers on computers using mathematics, and I was wondering if that was how rnd worked in petit computer. I created a sample program on ptc, looking like this

input "max num";num

t1$=mid$(time$,0,2)

t2$=mid$(time$,3,2)

t3$=mid$(time$,6,2)

t4$=t1$+t2$+t3$

tf$=right$(t4$,2)

time=val(tf$)

prime1=97:prime2=2663

a1=time*prime1

a2=a1+prime2

a3=a2%num

af=a3+1

?af

I am quite proud, because it is neat to see different numbers popping out of this equation. the way that a random number generator works is to create a very large number dependent on large primes and the time(usually done using milliseconds) and then a cyclic division(%) to find the remainder of the large number divided by the desired number. this can be used to create a semingly random number, even though it is quite predictable if you know the values. the one I have is done using the minutes and seconds of the current time. I want to know if this can be added to the rnd(function) page to clarify some things with how mechanical devices can come up with random numbers, and actually to see how cyclic division works, because I have not seen anyone using % in their programs. it would be nice to see this on a page to help people understand stuff. I would post the qr code to the program, but I don't have access to a qr code maker now that gamebridge's site went down 