java - How would I modify my code to search a multidimensional array diagonally from left to right and right to left? -
java - How would I modify my code to search a multidimensional array diagonally from left to right and right to left? - i have code searching multidimensional array left right , right left. what need search array top left bottom right,the top right bottom left, bottom left top right, , bottom right top left. what need alter in existing methods create new method want? // left right public static string findlefttoright (char[][]board, string word) { char[] letters = word.tochararray(); (int = 0; < board.length; i++){ (int j = 0; j < board[i].length; j++) { boolean found = true; (int k = 0; k < letters.length; k++) { if ((j+k >= board[i].length) || (letters[k] != board[i][j+k])) { found = false; break; } ...