
December 20th, 2006, 03:54 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
Quote: | Originally Posted by BaAa3 Hello !!!
If I have an array and I want to shift the hole array to the right or left.
a[1,2,3,4]
shift right = a[4,1,2,3] shift left = a[2,3,4,1] any idea !!
Thanks !!! |
Hey Ba,
I'm not all that fluent with ML anymore however, the following psuedo code should help.
last : rest_without_last
What you want to do cons's the last element into the rest of the elements, but not the last.
Take care,
Mark.
__________________
programming language development: www.netytan.com – Hula
|