ok so i'm writing a program that is to create an 8x8 2d array and fill said array with randomly generated numbers between 0-3, then i have to print said array to the screen. i have these parts dead on, working everytime. now my issue becomes that i have to compare elements in each row, column, diagonal, and sub diagonal to gleen if there are 3 or more consecutive numbers. i then have to print out the row, column, diagonal or sub diagonal containing the consecutive digits and then tell what number is repeated the required min of 3 times. THATS where i am stuck. I have no clue how to do this without just hard coding the whole thing. PLEASE help, this is due very very soon and i am sooooo lost. everything has to be in its own method.

here is what i have so far:

import java.util.*; //imports java utilities public class Project4 { //opens class body public static void main(String[] args) throws Exception { //opens main method Scanner keyboard = new Scanner(System.in); //imports scanner object int array; //declares an integer int r = 0, c = 0; //declares and initializes two integers int matrix[][] = new int[8][8]; //declares an array matrix = getArray(); //initializes array to the getArray method return printArray(matrix); rowAnalysis(matrix); columnAnalysis(matrix); diagonalAnalysis(matrix); subAnalysis(matrix); } //closes main method /** * pre-condition: called for from main method. * post condition: Finishes the array under given parameters * @return: returns the full array * @throws Exception */ public static int[][] getArray() throws Exception { //opens getArray method body final int matrix[][] = new int[8][8]; //declares an array int r = 0, c = 0; //declares and initializes integers for (r = 0; r < matrix.length; r++) { //opens first for loop for (c = 0; c < matrix[r].length; c++) { //opens nested for loop matrix[r][c] = (int) (Math.random() * 4); //gets a random number between 0 and 3 System.out.print(matrix[r][c] + " "); //prints out the number and a space } //ends nested for loop System.out.println(); //starts a new line for the 2d array } //ends first for loop return matrix;//[r][c]; //returns the printable array to main method once called } //ends getArray method body /** * pre-condition: called for by the main method * post-condition: Prints the array to the screen * @param array: sent the integer array from main method * no return */ public static void printArray(int[][] matrix) { //opens printArray method System.out.print(matrix); //prints the array to the screen } //ends the printArray method /** * pre-condition: called for rowAnalysis by the main method * post-condition: prints the rowAnalysis to the screen * @param array: sent the integer array from main method * no return */ public static void rowAnalysis(int[][] matrix) throws Exception { //opens the rowAnalysis method for (int r = 0; r < matrix.length - 1; r++){ for (int c = 0; c < matrix.length - 1; c++){ } } } //closes the rowAnalysis method /** * pre-condition: called for columnAnalysis by the main method * post-condition: prints the columnAnalysis to the screen * @param array: sent the integer array from main method * no return */ public static void columnAnalysis(int[][] matrix) { //opens the columnAnalysis method } //ends the columnAnalysis method /** * pre-condition: called for diagonalAnalysis by the main method * post-condition: prints the diagonalAnalysis to the screen * @param array: sent the integer array from main method * no return */ public static void diagonalAnalysis(int[][] matrix) { //opens the diagonalAnalysis method } //closes the diagonalAnalysis method /** * pre-condition: called for subAnalysis by the main method * post-condition: prints the subAnalysis to the screen * @param array: sent the integer array from main method * no return */ public static void subAnalysis(int[][] matrix) { //opens the subAnalysis method } //closes the subAnalysis method } //closes class body