@@ -0,0 +1,1052 @@
+package ru.matevosyan.lesson_5_Array;%0A%0Apublic class ArrayRotate %7B%0A%0A%09private int MaxSize = 4;%0A%09private int lastPosition = MaxSize - 1;%0A%09private int level = 0;%0A%09private int totLevel = MaxSize / 2;%0A%09%0A%09public int%5B%5D%5B%5D rotateMatrix(int value%5B%5D%5B%5D)%7B%0A%09%0A%09%09while (level %3C totLevel) %7B%0A%09%09%09%09%0A%09%09%09for (int i = level; i %3C lastPosition; i++) %7B%0A%0A%09%09%09%09%09%0A%09%09%09%09//this.swap(value%5Blevel%5D%5Bi%5D, value%5Bi%5D%5BlastPosition%5D);%0A%09%09%09%09//this.swap(value%5Blevel%5D%5Bi%5D, value%5BlastPosition%5D%5BlastPosition - i + level%5D);%0A%09%09%09%09//this.swap(value%5Blevel%5D%5Bi%5D, value%5BlastPosition - i + level%5D%5Blevel%5D);%0A%0A%09%09%09%09this.swap(value, level, i, i, lastPosition);%0A%09%09%09%09this.swap(value, level, i, lastPosition, lastPosition - i + level);%0A%09%09%09%09this.swap(value, level, i , lastPosition - i + level, level);%0A%09%09%09%09%09%09%09%09%09%09%09%0A%09%09%09%7D%0A%0A%09%09%09level++;%0A%09%09%09lastPosition--;%0A%09%09%7D%0A%09%09%0A%09%09return value;%0A%09%0A%09%7D%0A%0A%09//public void swap(int i, int j)%7B%0A%0A%09%09//int current = i;%0A%09%09//i = j;%0A%09%09//j = current;%0A%09%0A%09//%7D%0A%09public void swap(int arr%5B%5D%5B%5D, int i, int j, int a, int b)%7B%0A%0A%09%09int current = arr%5Bi%5D%5Bj%5D;%0A%09%09arr%5Bi%5D%5Bj%5D = arr%5Ba%5D%5Bb%5D;%0A%09%09arr%5Ba%5D%5Bb%5D = current;%0A%09%0A%09%7D%0A%0A%09%0A%09%0A%0A%7D

add ArrayRotate.java