A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Multidimensional Array Shuffle Problem

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    14

    Unhappy 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..

  2. #2
    Senior Member ozmic66's Avatar
    Join Date
    Oct 2005
    Posts
    472
    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.
    Pixelwave Flash-based iPhone framework
    iPhone Games: Flyloop | Freedom Run

    Twitter: Oztune

  3. #3
    Junior Member
    Join Date
    May 2011
    Posts
    14
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center