Logo

Programming-Idioms

History of Idiom 69 > diff from v31 to v32

Edit summary for version 32 by 1.7.4:
New JS implementation by user [1.7.4]
↷

Version 31

2018-12-18, 16:17:02

Version 32

2019-01-25, 11:41:47

Idiom #69 Seed random generator

Use seed s to initialize a random generator.

If s is constant, the generator output will be the same each time the program runs. If s is based on the current value of the system clock, the generator output will be different each time.

Idiom #69 Seed random generator

Use seed s to initialize a random generator.

If s is constant, the generator output will be the same each time the program runs. If s is based on the current value of the system clock, the generator output will be different each time.

Imports
const seed = require ('seedrandom')
Code
seed (s)
Comments bubble
s is impure—it can give different outputs with the same input.
Doc URL
https://www.npmjs.com/package/seedrandom