mardi 30 mai 2017

Scala Shuffle A List Randomly And repeat it

I want to shuffle a scala list randomly.

I know i can do this by using scala.util.Random.shuffle

But here by calling this i will always get a new set of list. What i really want is that in some cases i want the shuffle to give me the same output as before. So how can i achieve that?

Basically what i want to do is to shuffle a list randomly at first and then repeat it in the same order. For the first time i want to generate the list randomly and then based on some parameter repeat the same shuffling.




Aucun commentaire:

Enregistrer un commentaire