RSSAmplifier

galvanist · Apr 23, 2013

The VAX MTH$RANDOM Generator in Python

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

So I needed the ole’ VAX MTH$RANDOM for a puzzle. I like python. Here’s what I came up with after reading some gsl docs : 
 def vax_rand ( seed ): 
 a = 69069 
 c = 1 
 m = 2 ** 32 
 while True : 
 seed = divmod ( a * seed + c , m )[ 1 ] 
 yield seed 
 To use it (with a seed of 6), do this: v = vax_rand(6) and to get a number out of it, you could do…

Read on /posts/2013-04-23-the-vax-mthrandom-generator-in-python/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.