Hi everyone,
What you can do is get the factor and add the array position of the variable to that factor and then that will be the new array position of the variable
If the new variable position in the array exceeds the array length ,minus the the array length from the new array position of the variable.
Put this in a loop and loop it for all the variables in the array
I hope this helps you
Yours Sincerely
Richard West
freesoft_2000
Practically a Master Poster
623 posts since Jun 2004
Reputation Points: 25
Solved Threads: 10
Remember that arrays in Java don't grow so you need to take care of the buffering yourself.
If you move say 5 places to the right, create a buffer of 5 elements.
Move the last 5 elements out of the array into the buffer, then move every element in the array (except those 5) 5 places to the right.
Finally most those 5 elements into the first 5 positions in the original array.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337