Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program of wordSearch puzzle that use the following text file as an inpu

ID: 3782456 • Letter: W

Question

Write a program of wordSearch puzzle that use the following text file as an input. The output should be like this: PIXEL found (left) at (0,9). ( Use JAVA Array ) .Please do not use arrylist and the likes!

18 18
T P I R C S A V A J L E X I P I G E
L I A M E M O R Y M M O U S E N I L
C R A B K S A T X I N U Y H S T F G
D N D I R E C T O R Y E T A O E O O
P O W E R S U P P L Y N I R F R L O
U C O A S A E V A S S C R E T N D G
K I R O P K T Y P S H R U W W E E L
C D D E C P R E E A H Y C A A T R M
A N R I M A L L T D R P E R R E A T
B O L E N M E I E K E T S E E P H H
R C K I P R A F C V R I I R S U L M
E E B E I A R R I A B O O T M B O R
N S T W R A P R G R T N W B I N G O
N O O S G N D L O O D I N T I O I S
A N G M A K A U L A R A O T E A N R
C A E A S P T L T A I P O N R N D U
S N F I R E W A L L W R E I K O O C
T F D P R D H T O O T E U L B Y T E
JAVASCRIPT
PIXEL
INTERNET
GIF
GOOGLE
LCD
EMAIL
MEMORY
MOUSE
SHAREWARE
TASKBAR
UNIX
SECURITY
SOFTWARE
FOLDER
ICON
DIRECTORY

Explanation / Answer

// please find the code below . hope it solves your problem.
public class WordSearchpuzzel
{
private String pSource;
private String wSource;
private Graph graph;
private PrefixTree tree;

public void setPuzzleSource(String pzSource)
   {
       pSource = pzSource;
   }
public String getPuzzleSource()
   {
       return pSource;
   }

public void setWordSource(String wS)
   {   
       wSource = wS;   
   }
public String getWordSource()
    {  
      return wSource;
   }

public void setGraph(Graph g)
   {
       graph = g;
   }
public Graph getGraph()
   {
       return graph;
   }

public void setTree(PrefixTree t)
   {
       tree = t;
   }
public PrefixTree getTree()
   {
   if(tree == null) tree = new PrefixTree();
   return tree;
   }


public WordSearchpuzzel(String pSource, String wSource)
   {
setPuzzleSource(pSource);
setWordSource(wordSourcepuzzel);
}

// Where the action happens.
public void run() {
initalizeSources();

graph.setTree(getTree());

graph.forEachVertex((Integer row, Integer col) -> {
// i = dx values. -1 -> left, 0 -> current, 1 -> right
// j = dy values. -1 -> up, 0 -> current, 1 -> down
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
// If we didn't move up, and didn't move down, then
// skip this iteration.
if( i == 0 && j == 0) continue;
// Depth first search in one direction.
graph.dfs(row, col, i, j);
}
}
});
}
private void initalizeSources() {
final FileReader fileReader = new FileReader(getPuzzleSource());
final String delimiters = " ";
fileReader.forEachLine((String line, Integer lineNumber) -> {

if(lineNumber == 1)
       {
  
int size = new Integer(line);
  
setGraph(new Graph(size));
   }
       else
       {
  
String[] letters = line.split(" ");


for(int i = 0; i < letters.length; i++)
getGraph().addVertex(lineNumber - 2, i,
letters[i].charAt(0));
   }
});

fileReader.setFilePath(getWordSource());

fileReader.forEachLine((String line, Integer lineNumber) -> {
if(line.length() > 0) {
getTree().insert(line);
}
});
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote