prog output:Starting 4x4 game, words from enable1.txt, min word length 3.Reading word list from file enable1.txt... Read 172823 words.Building this game's lexicon... done.Stringpos 0word to check: leowordToCheck.length 3 Cur Center: 0NotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 0 row is: 0 col is: 0row: 0 and col: 0 row is: 0 col is: 0Grid[row][col] ASelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 1 row is: 0 col is: 0row: 0 and col: 1 row is: 0 col is: 1Grid[row][col] ESelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 2 row is: 0 col is: 1row: 0 and col: 2 row is: 0 col is: 2Grid[row][col] YSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 3 row is: 0 col is: 2row: 0 and col: 3 row is: 0 col is: 3Grid[row][col] USelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 4 row is: 0 col is: 3row: 1 and col: 0 row is: 1 col is: 0Grid[row][col] SSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 5 row is: 1 col is: 0row: 1 and col: 1 row is: 1 col is: 1Grid[row][col] NSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 6 row is: 1 col is: 1row: 1 and col: 2 row is: 1 col is: 2Grid[row][col] OSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: -25 at b0ggleLayout.FindAround(b0ggleLayout.java:136) at b0ggleLayout.FindWord(b0ggleLayout.java:109) at b0ggleLayout.FindWord(b0ggleLayout.java:126) at BogglePlayer.isOnBoard(BogglePlayer.java:26) at BoggleGUI.checkAndAddWordHuman(BoggleGUI.java:127) at BoggleGUI$WordEntryField$1.actionPerformed(BoggleGUI.java:682) at javax.swing.JTextField.fireActionPerformed(Unknown Source) at javax.swing.JTextField.postActionEvent(Unknown Source) at javax.swing.JTextField$NotifyAction.actionPerformed(Unknown Source) at javax.swing.SwingUtilities.notifyAction(Unknown Source) at javax.swing.JComponent.processKeyBinding(Unknown Source) at javax.swing.JComponent.processKeyBindings(Unknown Source) at javax.swing.JComponent.processKeyEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source) at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source) at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) X is : 7 row is: 1 col is: 2row: 1 and col: 3 row is: 1 col is: 3Grid[row][col] OSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 8 row is: 1 col is: 3row: 2 and col: 0 row is: 2 col is: 0Grid[row][col] TSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 9 row is: 2 col is: 0row: 2 and col: 1 row is: 2 col is: 1Grid[row][col] USelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 10 row is: 2 col is: 1row: 2 and col: 2 row is: 2 col is: 2Grid[row][col] ESelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 11 row is: 2 col is: 2row: 2 and col: 3 row is: 2 col is: 3Grid[row][col] VSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 0word to check: leoLooking for letter : lwordToCheck.length 3 Cur Center: 0 X is : 12 row is: 2 col is: 3row: 3 and col: 0 row is: 3 col is: 0Grid[row][col] LSelectedSquare[row][col] == unselected if false: false row is: 3 col is: 0Found & not selected Next row: 0Next col 0Looking for Letter To Check lFound letter at 12Found letter at row: 3 and col: 0Selected squre should be true: falseAt Spot LNext Letter is: eCurrent Row and Column : 0 0Found lettertocheck: eFound it at: 00next center: 0List with Locations in order -_-__-_-== List with Locations in order: 12locaTions in order 12WordToCheck leoStringpos 1word to check: leowordToCheck.length 3 Cur Center: 0NotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: 0 X is : 0 row is: 2 col is: 3row: 0 and col: 0 row is: 0 col is: 0Grid[row][col] ASelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: 0 X is : 1 row is: 0 col is: 0row: 0 and col: 1 row is: 0 col is: 1Grid[row][col] ESelectedSquare[row][col] == unselected if false: false row is: 0 col is: 1Found & not selected Next row: 0Next col 0Looking for Letter To Check eFound letter at 1Found letter at row: 0 and col: 1Selected squre should be true: falseAt Spot ENext Letter is: oCurrent Row and Column : 0 0LetterToCheck: oLetterToCheck is not found In FindAroundnext center: -100Not Found Around!NotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 2 row is: 0 col is: 1row: 0 and col: 2 row is: 0 col is: 2Grid[row][col] YSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 3 row is: 0 col is: 2row: 0 and col: 3 row is: 0 col is: 3Grid[row][col] USelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 4 row is: 0 col is: 3row: 1 and col: 0 row is: 1 col is: 0Grid[row][col] SSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 5 row is: 1 col is: 0row: 1 and col: 1 row is: 1 col is: 1Grid[row][col] NSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 6 row is: 1 col is: 1row: 1 and col: 2 row is: 1 col is: 2Grid[row][col] OSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 7 row is: 1 col is: 2row: 1 and col: 3 row is: 1 col is: 3Grid[row][col] OSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 8 row is: 1 col is: 3row: 2 and col: 0 row is: 2 col is: 0Grid[row][col] TSelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 9 row is: 2 col is: 0row: 2 and col: 1 row is: 2 col is: 1Grid[row][col] USelectedSquare[row][col] == unselected if false: falseNotABaseCase: Stringpos 1word to check: leoLooking for letter : ewordToCheck.length 3 Cur Center: -100 X is : 10 row is: 2 col is: 1row: 2 and col: 2 row is: 2 col is: 2Grid[row][col] ESelectedSquare[row][col] == unselected if false: false row is: 2 col is: 2Found & not selected Next row: -25Next col 0Looking for Letter To Check eFound letter at 10Found letter at row: 2 and col: 2 _____import java.util.ArrayList;import java.util.List;public class b0ggleLayout { private String[][] Grid; private String[] Board; private boolean[][] SelectedSquare; List<String> IntRepofStringOnBoard; List<Integer> LocationsInOrder = new ArrayList<Integer>(); //sets up the boggle board for use //this method works for sure public String[][] AssignGrid(String[] letterArray){ Board = letterArray; SelectedSquare = new boolean[Board.length][Board.length]; double sideLengthdbl = Math.sqrt(letterArray.length); int sideLengthint = (int)sideLengthdbl; Grid = new String[sideLengthint][sideLengthint]; for (int x = 0; x < letterArray.length; x++){ int row=x/4; int col=x%4; Grid[row][col]=letterArray[x]; } return Grid; } public List FindWord(String wordToCheck, int StringPos, int NextCenter, int BoardPosition, int row, int col){ System.out.println(" "); System.out.println("Stringpos " + StringPos); System.out.println("word to check: " + wordToCheck); System.out.println("wordToCheck.length " + wordToCheck.length()); System.out.println(" Cur Center: " + NextCenter); for(int x = 0; x < BoardPosition; x++){ System.out.println(" "); //finding the first letter linearly if(wordToCheck.length()<StringPos ){ //base case when the StringPosition to be checked is beyond the length of the Word To Check. System.out.println("Base Case!: "); for(int y = 0; y < LocationsInOrder.size(); y++){ /* simple loop to see * if the int representations * of the string locations are * being added in the 'correct * order * */ System.out.println("List with Locations in order: " + LocationsInOrder.get(y)); } System.out.println("locaTions in order " + LocationsInOrder.get(StringPos)); System.out.println("WordToCheck " + wordToCheck); System.out.println(" "); return LocationsInOrder; } else{ System.out.println("NotABaseCase: "); System.out.println(" "); System.out.println("Stringpos " + StringPos); System.out.println("word to check: " + wordToCheck); System.out.println("Looking for letter : " + wordToCheck.charAt(StringPos)); System.out.println("wordToCheck.length " + wordToCheck.length()); System.out.println(" Cur Center: " + NextCenter); System.out.println(" X is : " + x); System.out.println(" "); System.out.println(" row is: " + row); System.out.println(" col is: " + col); // I beleive the problem lays somewhere here int oldrow = row; // I can't quite think the recursion out correctly here int oldcol = col; String LetterToCheck = wordToCheck.charAt(StringPos)+""; row = x/Grid.length; col = x%Grid.length; int CurrentPosition = row * Grid.length+col; int nextrow = NextCenter/Grid.length; // trying to work some magic int nextcol = NextCenter%Grid.length; System.out.println("row: " + row + " and col: " + col); System.out.println(" row is: " + row); System.out.println(" col is: " + col); System.out.println("Grid[row][col] " + Grid[row][col]); System.out.println(" "); System.out.println("SelectedSquare[row][col] == unselected if false: " + SelectedSquare[row][col] ); System.out.println(" "); if (LetterToCheck.equalsIgnoreCase(Grid[row][col]) == true && SelectedSquare[row][col] == false ){ //found letter & not previously selected System.out.println(" row is: " + row); System.out.println(" col is: " + col); System.out.println("Found & not selected"); System.out.println(" Next row: " + nextrow); System.out.println("Next col " + nextcol); System.out.println(" "); System.out.println("Looking for Letter To Check " + LetterToCheck); System.out.println("Found letter at " + CurrentPosition); System.out.println("Found letter at row: " + row + " and col: " + col); LocationsInOrder.add(CurrentPosition); // add spot to List of ints to be returned System.out.println(" "); SelectedSquare[row][col]=true; // mark unselectable System.out.println(" "); if (wordToCheck.charAt(StringPos+1)+""!=null){ String NextLetterToCheck = wordToCheck.charAt(StringPos+1)+""; // get the next letter to check NextCenter = FindAround(CurrentPosition, NextLetterToCheck, nextrow, nextcol) ; //next center is the next center to } //check around for the next letter System.out.println("next center: " + NextCenter); if (NextCenter < -50){ // failure case System.out.println("Not Found Around!"); // the next letter is not around this value LocationsInOrder.remove(LocationsInOrder.size()-1); } else{ System.out.println("List with Locations in order -_-__-_-== "); for(int y = 0; y < LocationsInOrder.size(); y++){ // same loop as earlier to check for validity System.out.println("List with Locations in order: " + LocationsInOrder.get(y)); } System.out.println("locaTions in order " + LocationsInOrder.get(StringPos)); System.out.println("WordToCheck " + wordToCheck); System.out.println(" "); FindWord(wordToCheck, StringPos+1, NextCenter, BoardPosition, oldrow, oldcol); // recursive search for finding the next value } } } } return LocationsInOrder; } public int FindAround(int CenterTile, String NextLetter, int row, int col){ System.out.println("Selected squre should be true: " + SelectedSquare[row][col]); System.out.println("At Spot " + Board[CenterTile]); System.out.println("Next Letter is: " + NextLetter); /*positions to test * 1 row,col-1 left * 2 row-1,col-1 left & up * 3 row-1,col up * 4 row-1,col+1 up & right * 5 row,col+1 right * 6 row+1,col+1 right & down * 7 row+1,col down * 8 row+1,col-1 down & left * */ System.out.println("Current Row and Column : " + row + " " + col); if(row<0 || row > 3 || col <0 || col > 3 ){ System.out.println("not on board"); return -101; } if( ((row >= 0) && (col-1 >=0)) && NextLetter.equalsIgnoreCase(Grid[row][col-1])==true){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row-1) >=0 && (col-1 >=0)) && NextLetter.equalsIgnoreCase(Grid[row-1][col-1])==true){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row-1) >= 0 && (col <= 3)) && NextLetter.equalsIgnoreCase(Grid[row-1][col])==true){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row-1) >= 0 && (col+1 <=3 )) && NextLetter.equalsIgnoreCase(Grid[row-1][col+1])==true){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row >= 0) && (col+1 <= 3)) && NextLetter.equalsIgnoreCase(Grid[row][col+1])==true){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row+1 <=3 ) && (col >=0 )) && NextLetter.equalsIgnoreCase(Grid[row+1][col])==true){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row+1 <= 3) && (col-1 >= 0)) && Grid[row+1][col-1]==NextLetter){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } if( ((row+1 <= 3) && (col+1 <= 3)) && Grid[row+1][col+1]==NextLetter){ System.out.println("Found lettertocheck: " + NextLetter); System.out.println("Found it at: " + row * Grid.length+col); return row * Grid.length+col; } else System.out.println("LetterToCheck: " + NextLetter); System.out.println("LetterToCheck is not found In FindAround"); return -100; }}