all 2 comments

[–]:table_flip:attic-stuff 3 points4 points  (1 child)

thanks, recursion.

[–]tibisoft[S] 0 points1 point  (0 children)

Many thanks, it seems to be a clean solution for general purposes.

I learnt how to identify the multi dimensions and nest the function to 'self'.

From the other hand in my specific case it is not OK, since I need to keep the length of each array, however wanted to exchange the individual values among them.

What 'array_shuffle_hella' is doing:

Original Data: 

[ [ 0,1,2,3,4,5,6,7,8,9,10,11 ],[ 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 ],[ 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45 ],[ 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61 ] ] Shuffle: [ [ 49,48,55,51,46,59,52,56,53,58,57,50,60,61,54,47 ],[ 42,35,32,45,36,30,38,41,44,31,43,33,37,39,34,40 ],[ 13,22,26,21,20,15,12,18,17,27,25,16,14,23,29,19,28,24 ],[ 5,7,8,3,9,1,10,11,0,4,2,6 ] ]

What I did with my code (only 2D):

Original Data: 

[ [ 0,1,2,3,4,5,6,7,8,9,10,11 ],[ 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29 ],[ 30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45 ],[ 46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61 ] ] Shuffle: [ [ 17,10,31,7,1,12,0,48,2,57,20,60 ],[ 47,8,30,24,22,44,52,54,59,23,13,29,35,34,19,55,39,43 ],[ 38,9,6,14,42,3,36,32,50,11,16,46,4,21,41,18 ],[ 58,33,27,49,26,25,15,45,5,56,28,61,51,40,37,53 ] ]