Post Reply 
(PC-1211) Multiple Dice Throw
03-23-2021, 04:06 PM (This post was last modified: 03-23-2021 04:14 PM by pyedog.)
Post: #9
RE: (PC-1211) Multiple Dice Throw
(03-20-2021 11:48 AM)SlideRule Wrote:    70: B=997B+π :B=B-INT B:C=INT 6B+1
I think this random number generator might come from page 241 of "119 Practical Programs For The TRS-80 Pocket Computer", although the book's author probably got it from somewhere else.

A very similar slightly faster version from
R=221R + 0.2113:R=R-INT R
although I'm not sure how well distributed it winds up being.

BSD used to use something like
R=1103515245+12345 MOD 2^31
which was horrible.

I think Microsoft Windows uses (or used to use) something like
R=214013R+2531011 MOD 2^31
which seems to be slightly better.

But on a PC-1211 the BSD and Microsoft variations are significantly slower.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
(PC-1211) Multiple Dice Throw - SlideRule - 03-20-2021, 11:48 AM
RE: (PC-1211) Multiple Dice Throw - C.Ret - 03-21-2021, 09:29 AM
RE: (PC-1211) Multiple Dice Throw - robve - 03-23-2021, 02:43 PM
RE: (PC-1211) Multiple Dice Throw - robve - 03-23-2021, 03:56 PM
RE: (PC-1211) Multiple Dice Throw - pyedog - 03-23-2021 04:06 PM

User(s) browsing this thread: 1 Guest(s)