Can anyone give me advice on how to randomize an array of objects? I want to do this without using a for loop to swop 2 random objects over and over.
Is there any other way to do it?
Thanks.
I don't think there is a way to do what you require without using some kind of interative functionality (i.e. a for loop, while loop, recursive function etc.). If you find a third-party function which performs what you require, I'd be willing to bet that it also uses some kind of iterative code. There's no built-in ArrayRandomizer package as far as I'm aware... Why are you so adamant about not using a for loop?
I don't think there is a way to do what you require without using some kind of interative functionality (i.e. a for loop, while loop, recursive function etc.). If you find a third-party function which performs what you require, I'd be willing to bet that it also uses some kind of iterative code. There's no built-in ArrayRandomizer package as far as I'm aware... Why are you so adamant about not using a for loop?
Regards,
Im not overly fussed about using a for loop, and I have no real reason not too (except that everyone will probably use that). I was just looking for something a bit different as a for loop would be nothing new.
What Im trying to do is shuffle a deck of cards, and I thought there might be a direct way of randomizing an array of objects.