lundi 10 décembre 2018

Random_shuffle alternative in C++ Builder6

As the title says, I'm trying to find a method to shuffle an array. The C Builder doesn't seem to have random_shuffle() and I don't know how to do it, I can't find much about this program on google. To be more specific, I'm trying to do a memory matching game that has 16 pairs. I tried implementing something to give each card a random position(position 0, 1, 2, .. etc) but I don't know how to do it without having a value duplicated. So the easiest method I see is creating an array a[]={0,1,2,...31} and shuffling the values somehow. Is it possible to do anything like this? If not, do I have any alternatives? I hope my question is understandable.




Aucun commentaire:

Enregistrer un commentaire