vendredi 29 septembre 2017

Java, random selection from an array with no repetition [duplicate]

This question already has an answer here:

How can I randomly select elements from an array and move them to different smaller arrays with no repetition.

For example my original array has the numbers 1-52 in it (representing each card in a standard deck). I want to randomly place each card in a pile without any repetition (like a game of solitaire).

Is there a a function for random selection like this?




Aucun commentaire:

Enregistrer un commentaire