From: Robert Klemme Date: 2005-09-22T21:56:40+09:00 Subject: Re: hi, i'm new. plus one question Michael Ehehalt 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