public static int curRow = 10;
public static int curCol = 10;
public static boolean stop = false;
public static String[][] wordSearch = {{"H","M","G","R","R","A","U","S","G","U"},
{"U","S","M","J","E","A","F","R","K","W"},
{"X","M","C","L","P","J","D","N","M","S"},
{"I","A","F","O","O","S","M","X","A","F"},
{"R","R","J","O","L","O","O","P","T","N"},
{"T","G","B","C","E","H","X","M","H","W"},
{"A","O","G","H","V","Y","R","B","Y","M"},
{"M","R","A","J","E","L","M","A","X","L"},
{"R","P","W","A","D","T","A","C","Y","B"},
{"H","N","S","A","I","T","E","R","Y","X"}};//Default
public static String userInput = "";
public static Scanner kboard = new Scanner(System.in);
private static void searchDiagonalCenterToRight(String word) {//Center to bottom Right. Diagnol Works, debug to go along column is needed
int rowOn = 0;
int colOn = 0;
int resetableCol = curCol;
resetableCol--;//Just resets everything then starts again.
int decreaser = curCol;//What to decrease by everytime it runs 10,9,8,7 all the way to 1
int resetableDec = decreaser;
resetableDec--;
char c;
String toFind = word.toUpperCase();
String developingInverse = "";
int integer = 0;
for(int row = 0; row < curRow; row++)//Matrices Row
{
for(int i = 0; i <= resetableDec; i++)
{
String developingWord = "";
integer = i;
for(int j = integer; j <= resetableDec; j++,integer++)
{
System.out.println("\n\n" + j + " " + integer + " "+ i + " " + row);
c = wordSearch[j][integer+row].charAt(0);//Sets to whatever letter it is on
char uC = Character.toUpperCase(c);
developingWord = developingWord + "" +uC;
System.out.println("On Row: " + row + " Started From: " + integer + " Now On: " + j);
System.out.println("Processing Letter: " + wordSearch[j][integer] + " Adding Letter To: " + developingWord);
if(toFind.equals(developingWord))
{
rowOn = row; colOn = i;
rowOn++; colOn++;
System.out.println("\nLocated Word: " + toFind + ". Word Was Diagonal Located Within The Row.");
System.out.println("Row " + (rowOn) + " and Starting At Column " + (colOn));
stop = true;
return;
}
StringBuffer sb = new StringBuffer(developingWord);
sb.reverse();
developingInverse = sb.toString();
if(toFind.equals(developingInverse)) {
rowOn = row; colOn = i;
rowOn++; colOn++;
System.out.println("\nLocated Word: " + toFind + ". Word Was Diagonal Located Reversed Within The Row.");
System.out.println("Row " + (rowOn) + " and Starting At Column " + (colOn));
stop = true;
return;
}
}
}
resetableDec--;
}
System.out.println("\nNo Matching Word Was Found, Moving To Diagonal Center To Left.");
}