Python Random vs. Cython C Rand for Dice Rolls
C.D. Reimer
chris at cdreimer.com
Sun Jun 7 14:56:16 EDT 2015
On 6/7/2015 11:33 AM, Steven D'Aprano wrote:
> C rand is not even close to random. The technical term for it is "shite".
Looking through the BASIC book, I remembered all the tricks needed to
get a half-way decent number generator on a 1MHz processor back in the
day. Either the numbers start repeating after a while or get stuck on a
particular number. That's one of the challenges of converting these old
games from BASIC to Python. A lot of the stuff done in BASIC was meant
to get around the hardware limitations of the early computers.
Chris R.
More information about the Python-list
mailing list