package ru.parsentev.task_015;

import org.slf4j.Logger;

import static org.slf4j.LoggerFactory.getLogger;

/**
 * TODO: comment
 *
 * @author parsentev
 * @since 28.07.2016
 */
public class CycleShift {
    private static final Logger log = getLogger(CycleShift.class);

    private final int[] values;

    public CycleShift(final int[] values) {
        this.values = values;
    }

    public int[] shift(int position) {
        for (int j = 0; j < position; j++) {
            int end = values[values.length - 1];
            System.arraycopy(values, 0, values, 1, values.length - 2 + 1);
            values[0] = end;
        }
        return values;
    }
}

@@ -528,70 +528,110 @@
     
-System.arraycopy(values, 0,
+for (int i = values.length - 1; i %3E 0; i--) %7B%0A               
  values
-, 1,
+%5Bi%5D =
  values
-.length - 2 + 1);
+%5Bi - 1%5D;%0A            %7D
 %0A   
@@ -695,10 +695,11 @@
 ;%0A    %7D%0A
-
 %7D%0A
+%0A

Task_015