Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 random module lacks instantiation
#1
i don't see any way to make instances of the random module main class. when re-running sequences from the original seed, this makes it easy to have 2 or more sequences of the same, or different, seeds. it also can allow making parallel (such as with threads) initial runs of a seed sequence. the interface should be simple and obvious. just create a new instance and it will have all the same attributes and methods. how that's implemented, i have no idea.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#2
>>> import random
>>> r = random.Random()
>>> r.seed(801)
>>> r.random()
0.10513447378227592
>>> r.random()
0.3553035267725949
>>> s = random.Random()
>>> s.seed(801)
>>> s.random()
0.10513447378227592
>>> s.random()
0.3553035267725949
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote
#3
now interleave r and s.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote
#4
That's on you.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures

Quote

Top Page

Forum Jump:


Users browsing this thread: 1 Guest(s)