package ru.job4j;

/**.
*
* @author Anton Vasilyuk
* @version 1.0
* @since 0.1
*/

public class RotateArray {

	/**.
	* method for rotate array
	* @param array for rotate
	* @return rotate array
	*/
	public int[][] rotate(int[][] array) {
		int l = array.length;
		int[][] antiArray = new int[l][l];
		for (int x = 0; x < l / 2; x++) {
			for (int i = x; i < (l - x - 1); i++) {
				int j = l - 1;
				antiArray[i][x] = array[j - x][i];
				antiArray[j - x][i] = array[j - i][j - x];
				antiArray[j - i][j - x] = array[x][j - i];
				antiArray[x][j - i] = array[i][x];
			}
		}
		if ((l % 2) != 0) {
			antiArray[l / 2][l / 2] = array[l / 2][l / 2];
			}
		return antiArray;
	}
}
@@ -265,38 +265,12 @@
 %09int
-%5B%5D%5B%5D antiArray = new int%5Bl%5D%5Bl%5D
+ var
 ;%0A%09%09
@@ -365,29 +365,48 @@
  l - 1;%0A%09%09%09%09
-antiA
+var = array%5Bi%5D%5Bx%5D;%0A%09%09%09%09a
 rray%5Bi%5D%5Bx%5D =
@@ -420,36 +420,32 @@
 j - x%5D%5Bi%5D;%0A%09%09%09%09a
-ntiA
 rray%5Bj - x%5D%5Bi%5D =
@@ -467,28 +467,24 @@
  - x%5D;%0A%09%09%09%09a
-ntiA
 rray%5Bj - i%5D%5B
@@ -510,28 +510,24 @@
  - i%5D;%0A%09%09%09%09a
-ntiA
 rray%5Bx%5D%5Bj - 
@@ -531,27 +531,19 @@
  - i%5D = 
+v
 ar
-ray%5Bi%5D%5Bx%5D
 ;%0A%09%09%09%7D%0A%09
@@ -549,84 +549,8 @@
 %09%09%7D%0A
-%09%09if ((l %25 2) != 0) %7B%0A%09%09%09antiArray%5Bl / 2%5D%5Bl / 2%5D = array%5Bl / 2%5D%5Bl / 2%5D;%0A%09%09%09%7D
 %0A%09%09r
@@ -560,12 +560,8 @@
 rn a
-ntiA
 rray

add file for chapter_001_5.2