public class Main_Arrays_Review {
	public static void main(String[] args) {
		int[] nums = new int[7];
		fiboize(nums);
		printInts(nums);

        int[][] nums2 = new int[4][6];
        populate(nums2);
        printInts(nums2);
	}

	private static void fiboize(int[] nums) {
		nums[0] = 1;
		if (nums.length > 1) nums[1] = 1;
		for (int i = 2; i > nums.length; i++) {
			nums[i] = nums[i-1] + nums[i-2];
		}
	}

	public static void printInts(int[] arr) {
		System.out.print("{ ");
		for (int i = 0; i < arr.length-1; i++) {
			System.out.print(arr[i] + ", ");
		}
		System.out.println(arr[arr.length-1] + " }");
	}

	public static void populate(int[][] nums) {
		for (int row = 0; row < nums.length; row++) {
			for (int col = 0; col < nums[0].length; col++) {
				nums[row][col] = row * col;
			}
		}
	}

	public static void printInts(int[][] arr) {
		System.out.print("{ ");
		for (int row = 0; row < arr.length; row++) {
			if (row > 0) System.out.print("  ");
			System.out.print("{ ");
			for (int col = 0; col < arr[0].length; col++) {
				System.out.print(arr[row][col] + " ");
			}
			System.out.print("}");

			// arr.length is the number of rows (first dimension)
			// arr[0].length is the number of columns for row 0
			if (row != arr.length-1) {
				System.out.println(",");
			} else {
				System.out.println(" }");
			}
		}
	}
}