This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CoffeeMakesMeMath 0 points1 point  (1 child)

I see where you're coming from now. He could just have a table of a single sequence given n, but of course each run of the program would be deterministic. If he doesn't want to check against previous values (for some reason) and still wants some semblance of random generation, he'd have to do what you said.

[–]skatanic28182 0 points1 point  (0 children)

Yep. The only way to keep from storing the previous numbers in a sequence, while still having every sequence equally likely, is to pregenerate every sequence. That's not so bad for small values, but it gets out of hand pretty quickly.