Although any number can end up in any position, without something to break up the groups between repetitions, the groups of numbers will remain grouped:

#! perl -slw use strict; sub by8 { map{ [ @_[ $_*8 .. ( $_ +1 ) *8 - 1 ] ] } shuffle( 0 .. 7 ); } sub shuffle { for ( 0 .. $#_ ) { $a = $_ + rand( @_ )-$_ ; @_[ $_, $a ] = @_[ $a, $_ ] ; } return @_; } sub LRShuffle { map{ shuffle @$_; } by8 @_; } my @list = 0 .. 63; print 'Shuffled Once'; print @$_ for by8 LRShuffle @list; my @times10 = @list; @times10 = LRShuffle @times10 for 1 .. 10; print "\nShuffled 10 times"; print @$_ for by8 @times10; __END__ P:\test>498952 Shuffled Once 50 48 53 51 49 52 55 54 20 23 18 17 22 16 19 21 59 58 56 63 57 62 61 60 25 29 27 31 28 24 26 30 41 45 46 43 47 44 40 42 13 11 9 10 8 15 12 14 38 37 33 35 36 34 32 39 2 4 7 0 5 1 6 3 Shuffled 10 times 14 12 13 11 8 15 10 9 16 21 23 17 22 20 18 19 44 45 40 41 42 47 43 46 6 7 0 5 3 4 2 1 32 38 39 34 36 35 37 33 55 48 53 50 52 49 54 51 59 57 56 58 62 61 63 60 30 25 26 28 24 27 31 29

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

In reply to Re^3: Random Math Question by BrowserUk
in thread Random Math Question by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.