-
Multidimensional Array Shuffle Problem
Hi,
I am working with a game where I need to use 3d array.
I take random two elements from it and interchange their level,row and column positions . I am able to do this through a single dimensional array. But after doing this I can reflect the changes i made to objects in that 3d array.
So I need to reshuffle this array. Because the array is containing different card objects of a class cards. So I need to reshuffle this cards within the array according to its level,row and columns resp.
Please help..
-
Senior Member
Hmm, I kinda get what you're saying but I'm sure what the exact issue is...
Whenever I need to build a multi-dimensional array though I always just use a single array and set/get from it in a multi-dimensional fashion. Since all the elements are just stored in a single list they're really simple to shuffle.
-
oh that is something new to me. I would like to learn this way of urs. So could u please show it through a small example.
That would be great.
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|