Pure python implementation of Mersenne Twister?

PoulsenL at capanalysis.com PoulsenL at capanalysis.com
Tue Oct 29 17:33:58 CET 2002


Thanks for the assist.  I didn't want to reinvent the wheel if it had
already been accomplished, but needless to say I appreciate the help. After
4 years of lurking and the occasional post I am still dumbfounded by how
helpful people are on this list.

Loren

-----Original Message-----
From: Sean 'Shaleh' Perry [mailto:shalehperry at attbi.com]
Sent: Tuesday, October 29, 2002 11:25 AM
To: python-list at python.org
Subject: Re: Pure python implementation of Mersenne Twister?


On Tuesday 29 October 2002 07:25, PoulsenL at capanalysis.com wrote:
> I know of at least 3 implementations of the Mersenne Twister algorithm as
C
> extensions for python, but has anyone written one in pure python, for
> educational purposes, for example?
>
> Thanks in advance,
>
> Loren

so I hit google, found the mersenne home page, grabbed a C source and 
transliterated it to python.  The two output identical results so i have
some 
faith in the translation.  Took me about 15 minutes, testing and all.

Attached is the .py and the original .c.




More information about the Python-list mailing list