mardi 22 septembre 2020

How many swaps to randomize an array?

I am making a game where there will a deck of tiles in a random order. To randomize the order of the tiles I will probably start with them in a sorted array, then have a loop where two random indices are picked and I will swap those two elements.

My question is how many swaps until the array is considered completely random, or virtually completely random?




Aucun commentaire:

Enregistrer un commentaire