in reply to How to shuffle this AoA

I must admit that I am struggling to deduce the criteria for which is an allowed shuffle and which is not. Perhaps you could explain?


🦛

Replies are listed 'Best First'.
Re^2: How to shuffle this AoA
by BillKSmith (Monsignor) on Dec 17, 2020 at 15:21 UTC
    My guess is that a row is not allowed if it is a 'shifted' version of any previous row. There must be an existing name for such things.

    UPDATE: The name that I wanted is Cyclic-Permutation (The 'restricted definition').

    Bill
Re^2: How to shuffle this AoA
by kcott (Archbishop) on Dec 18, 2020 at 02:24 UTC

    G'day hippo,

    I'm seeing this pattern:

    • In the first (acceptable) result, all elements have a different order and no elements have been previously used.
    • In the second (unacceptable) result: the first element has the same order; the third element has been previously used.

    I put this here to keep all the guesswork together. It was an afterthought; see code written earlier.

    — Ken

Re^2: How to shuffle this AoA
by choroba (Cardinal) on Dec 17, 2020 at 14:42 UTC
    My guess: No values repeated in a column. But let's wait for a reply.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      My guess: No values repeated in a column.

      That was my first guess too, but the 4's are repeated in the third column of the first example.

        Oops, are they? I might need stronger glasses, then :-(

        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^2: How to shuffle this AoA
by Bod (Parson) on Dec 17, 2020 at 21:18 UTC
    I must admit that I am struggling to deduce the criteria for which is an allowed shuffle and which is not.

    I did sit puzzled for a short while wondering if I was missing something obvious.
    It's a relief to learn I am not the only one struggling to comprehend the criteria!