0

I can swap two tiles, however, when I need to shuffle them, I need each tile to have a unique position. I've tried setting up array's for the x and y position of both the tiles to be swapped checking against the randomly generated number to make sure it's position hasn't been taken already but as you could probably tell that was super uneffective.

How would I go about swapping two tiles which haven't already been swapped.

2
Contributors
2
Replies
12
Views
2 Years
Discussion Span
Last Post by Doogledude123
0

Do you just want to shuffle all the Tiles?

Put them all in a List and call shuffle()
Then simply re-populate your x,y grid with the Tiles in their shuffled order.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.