From: Meino Christian Cramer Date: 2004-08-17T14:12:04+09:00 Subject: Q: Shifting a hash anf and array Hi, I am looking for a neat "trick" to shift the contents of an array and an hash. I know, that this is more or less explicitely programmable in a few lines, but may be there is something faster, trickier, nicer than that. It should work like this: Contents of the array before the trick: 1 2 3 4 5 6 7 8 9 0 index A B C D E F G H I J contents (execute *trick*) Contents of the array after the trick: 1 2 3 4 5 6 7 8 9 0 index J A B C D E F G H I contents And now the shift of an hash: Contents of the hash before the trick: A B C D E F G H I J key 1 2 3 4 5 6 7 8 9 0 value (execute *trick*) Contents of the hash after the trick: A B C D E F G H I J key 0 1 2 3 4 5 6 7 8 9 value Both are very similiar. I am curious, how "compressed" and/or "tricky" a working code can be to do the *trick*.... :) (I know, that this most often does not result in "good code" or "something which can be taken as an example for master programming" :) ...but I always intersted in "thinking tricky" ... just for the fun of it and for the production release :))) Thank you very much fro any idea! Ruby.use! Meino