Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { private static void moveCells(int width, int height, ArrayList<ArrayList<Integer>> source, int[][] destination) { for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { destination[x][y] = source.get(y).get(x); } } } }