Michael Ehehalt <michael.ehehalt / no-spam.fecher.de> wrote:
> Hi,
>
> the code:
>
>  idea = ["a","b","c","d"]
>  idea.push( idea.shift )
>
> lets the array rotate to the left and returns ["b", "c", "d", "a"]
>
> the code:
>
>  idea = ["a","b","c","d"]
>  idea.unshift( idea.pop )
>  p idea
>
> lets rotate to the right and returns: ["d", "a", "b", "c"]
>
> Is this what you mean?

As Travis wanted the original array unchanged, you'd have to insert a #dup 
or #clone somewhere, e.g.

idea = ["a","b","c","d"]
cp = idea.dup
cp.push( cp.shift )

etc.

Kind regards

    robert