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 0 word to check: leo wordToCheck.length 3 Cur Center: 0 NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 0 row is: 0 col is: 0 row: 0 and col: 0 row is: 0 col is: 0 Grid[row][col] A SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 1 row is: 0 col is: 0 row: 0 and col: 1 row is: 0 col is: 1 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 2 row is: 0 col is: 1 row: 0 and col: 2 row is: 0 col is: 2 Grid[row][col] Y SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 3 row is: 0 col is: 2 row: 0 and col: 3 row is: 0 col is: 3 Grid[row][col] U SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 4 row is: 0 col is: 3 row: 1 and col: 0 row is: 1 col is: 0 Grid[row][col] S SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 5 row is: 1 col is: 0 row: 1 and col: 1 row is: 1 col is: 1 Grid[row][col] N SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 6 row is: 1 col is: 1 row: 1 and col: 2 row is: 1 col is: 2 Grid[row][col] O SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 Exception 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: 2 row: 1 and col: 3 row is: 1 col is: 3 Grid[row][col] O SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 8 row is: 1 col is: 3 row: 2 and col: 0 row is: 2 col is: 0 Grid[row][col] T SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 9 row is: 2 col is: 0 row: 2 and col: 1 row is: 2 col is: 1 Grid[row][col] U SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 10 row is: 2 col is: 1 row: 2 and col: 2 row is: 2 col is: 2 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 11 row is: 2 col is: 2 row: 2 and col: 3 row is: 2 col is: 3 Grid[row][col] V SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: leo Looking for letter : l wordToCheck.length 3 Cur Center: 0 X is : 12 row is: 2 col is: 3 row: 3 and col: 0 row is: 3 col is: 0 Grid[row][col] L SelectedSquare[row][col] == unselected if false: false row is: 3 col is: 0 Found & not selected Next row: 0 Next col 0 Looking for Letter To Check l Found letter at 12 Found letter at row: 3 and col: 0 Selected squre should be true: false At Spot L Next Letter is: e Current Row and Column : 0 0 Found lettertocheck: e Found it at: 00 next center: 0 List with Locations in order -_-__-_-== List with Locations in order: 12 locaTions in order 12 WordToCheck leo Stringpos 1 word to check: leo wordToCheck.length 3 Cur Center: 0 NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: 0 X is : 0 row is: 2 col is: 3 row: 0 and col: 0 row is: 0 col is: 0 Grid[row][col] A SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: 0 X is : 1 row is: 0 col is: 0 row: 0 and col: 1 row is: 0 col is: 1 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false row is: 0 col is: 1 Found & not selected Next row: 0 Next col 0 Looking for Letter To Check e Found letter at 1 Found letter at row: 0 and col: 1 Selected squre should be true: false At Spot E Next Letter is: o Current Row and Column : 0 0 LetterToCheck: o LetterToCheck is not found In FindAround next center: -100 Not Found Around! NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 2 row is: 0 col is: 1 row: 0 and col: 2 row is: 0 col is: 2 Grid[row][col] Y SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 3 row is: 0 col is: 2 row: 0 and col: 3 row is: 0 col is: 3 Grid[row][col] U SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 4 row is: 0 col is: 3 row: 1 and col: 0 row is: 1 col is: 0 Grid[row][col] S SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 5 row is: 1 col is: 0 row: 1 and col: 1 row is: 1 col is: 1 Grid[row][col] N SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 6 row is: 1 col is: 1 row: 1 and col: 2 row is: 1 col is: 2 Grid[row][col] O SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 7 row is: 1 col is: 2 row: 1 and col: 3 row is: 1 col is: 3 Grid[row][col] O SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 8 row is: 1 col is: 3 row: 2 and col: 0 row is: 2 col is: 0 Grid[row][col] T SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 9 row is: 2 col is: 0 row: 2 and col: 1 row is: 2 col is: 1 Grid[row][col] U SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: leo Looking for letter : e wordToCheck.length 3 Cur Center: -100 X is : 10 row is: 2 col is: 1 row: 2 and col: 2 row is: 2 col is: 2 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false row is: 2 col is: 2 Found & not selected Next row: -25 Next col 0 Looking for Letter To Check e Found letter at 10 Found 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 IntRepofStringOnBoard; List LocationsInOrder = new ArrayList(); //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() 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; } }