## random-sided Riffle shuffle sub riffle { if (rand() < 0.5) { splice @_, @_/2 - $_, 0, pop for 0 .. (@_/2)-1; } else { splice @_, @_/2 + $_, 0, shift for 0 .. (@_/2)-1; } return @_; }