sub shuffle{ my @cards = @_; foreach $card(@cards){ my @element1 = (pop(@cards), shift(@cards), pop(@cards)); my @element2 = (shift(@cards), pop(@cards), shift(@cards)); push(@cards, @element1, @element2); } return @cards; }