in reply to interleave (single shuffle)

It took me a while to work out what you were getting at here. I'd call this interleave, not shuffle. The two arrays as arguments are a blind: they may or may not have the same number of elements. If warnings are active, they should add to an even number of elements.

This is terribly obfuscated, if it works at all. What exactly do you mean it to do?

Update: The Storm King reminds me that 'perfect shuffle' is the term for a uniform distribution of order. Not what your function produces.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: perfect shuffle
by sauoq (Abbot) on Nov 23, 2003 at 19:30 UTC

    I believe a magician or card cheat would call it a perfect shuffle.

    I agree, however, that it should be given a different name in this context. I'd also prefer if the code was clearer.

    -sauoq
    "My two cents aren't worth a dime.";