dimanche 14 août 2016

How do I use Random generators in elm 0.17 with a user-specified seed?

In Elm 0.17, I'd like to run a program that relies on random numbers, but I'd like to have a user-specified seed. This is to have reproducible results across multiple user sessions: users who enter the same seed should see the same results.

But I can't figure out how to affect the behavior of built-in functions like:

Random.list 10 (Random.int 0 100)

With a call like the one above, I want to get the same list of 10 random numbers each time I feed in the same seed. But I can't figure out how to feed in a seed at all. I'd appreciate any help!




Aucun commentaire:

Enregistrer un commentaire