Logo

Programming-Idioms

History of Idiom 70 > diff from v10 to v11

Edit summary for version 11 by :

Version 10

2015-08-22, 22:50:43

Version 11

2015-09-03, 16:42:58

Idiom #70 Use clock as random generator seed

Get the current date and provide it as a seed to a random generator. The generator sequence will be different at each run.

Idiom #70 Use clock as random generator seed

Get the current date and provide it as a seed to a random generator. The generator sequence will be different at each run.

Code
Random.new
Comments bubble
Don't use time for seeding. Just use the initializer without any arguments.