Program out put: 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: doe wordToCheck.length 3 Cur Center: 0 NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] V SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] I SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] M SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] P SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] S SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d wordToCheck.length 3 Cur Center: 0 X is : 7 row is: 1 col is: 2 row: 1 and col: 3 row is: 1 col is: 3 Grid[row][col] H SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] O SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] M SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] H SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d 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] A SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 0 word to check: doe Looking for letter : d wordToCheck.length 3 Cur Center: 0 X is : 13 row is: 3 col is: 0 row: 3 and col: 1 row is: 3 col is: 1 Grid[row][col] D SelectedSquare[row][col] == unselected if false: false row is: 3 col is: 1 Found & not selected Next row: 3 Next col 1 Looking for Letter To Check d Found letter at 13 Found letter at row: 3 and col: 1 Selected squre should be true: true At Spot D Next Letter is: o Current Row and Column : 3 1 Found lettertocheck: o Found it at: 121 next center: 13 List with Locations in order -_-__-_-== List with Locations in order: 13 locaTions in order 13 WordToCheck doe Stringpos 1 word to check: doe wordToCheck.length 3 Cur Center: 13 NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 0 row is: 3 col is: 0 row: 0 and col: 0 row is: 0 col is: 0 Grid[row][col] V SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 1 row is: 0 col is: 0 row: 0 and col: 1 row is: 0 col is: 1 Grid[row][col] I SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 2 row is: 0 col is: 1 row: 0 and col: 2 row is: 0 col is: 2 Grid[row][col] M SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 3 row is: 0 col is: 2 row: 0 and col: 3 row is: 0 col is: 3 Grid[row][col] P SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 4 row is: 0 col is: 3 row: 1 and col: 0 row is: 1 col is: 0 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 5 row is: 1 col is: 0 row: 1 and col: 1 row is: 1 col is: 1 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 6 row is: 1 col is: 1 row: 1 and col: 2 row is: 1 col is: 2 Grid[row][col] S SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 7 row is: 1 col is: 2 row: 1 and col: 3 row is: 1 col is: 3 Grid[row][col] H SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 1 word to check: doe Looking for letter : o wordToCheck.length 3 Cur Center: 13 X is : 8 row is: 1 col is: 3 row: 2 and col: 0 row is: 2 col is: 0 Grid[row][col] O SelectedSquare[row][col] == unselected if false: false row is: 2 col is: 0 Found & not selected Next row: 2 Next col 0 Looking for Letter To Check o Found letter at 8 Found letter at row: 2 and col: 0 Selected squre should be true: true At Spot O Next Letter is: e Current Row and Column : 2 0 Found lettertocheck: e Found it at: 80 next center: 8 List with Locations in order -_-__-_-== List with Locations in order: 13 List with Locations in order: 8 locaTions in order 8 WordToCheck doe Stringpos 2 word to check: doe wordToCheck.length 3 Cur Center: 8 NotABaseCase: Stringpos 2 word to check: doe Looking for letter : e wordToCheck.length 3 Cur Center: 8 X is : 0 row is: 1 col is: 3 row: 0 and col: 0 row is: 0 col is: 0 Grid[row][col] V SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 2 word to check: doe Looking for letter : e wordToCheck.length 3 Cur Center: 8 X is : 1 row is: 0 col is: 0 row: 0 and col: 1 row is: 0 col is: 1 Grid[row][col] I SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 2 word to check: doe Looking for letter : e wordToCheck.length 3 Cur Center: 8 X is : 2 row is: 0 col is: 1 row: 0 and col: 2 row is: 0 col is: 2 Grid[row][col] M SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 2 word to check: doe Looking for letter : e wordToCheck.length 3 Cur Center: 8 X is : 3 row is: 0 col is: 2 row: 0 and col: 3 row is: 0 col is: 3 Grid[row][col] P SelectedSquare[row][col] == unselected if false: false NotABaseCase: Stringpos 2 word to check: doe Looking for letter : e wordToCheck.length 3 Cur Center: 8 X is : 4 row is: 0 col is: 3 row: 1 and col: 0 row is: 1 col is: 0 Grid[row][col] E SelectedSquare[row][col] == unselected if false: false row is: 1 col is: 0 Found & not selected Next row: 1 Next col 0 Looking for Letter To Check e Found letter at 4 Found letter at row: 1 and col: 0 Exception in thread "AWT-EventQueue-0" java.lang.StringIndexOutOfBoundsException: String index out of range: 3 at java.lang.String.charAt(Unknown Source) at b0ggleLayout.FindWord(b0ggleLayout.java:107) at b0ggleLayout.FindWord(b0ggleLayout.java:126) 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) ______ 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()+1 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; } }