They have a magnificent team. These people are always kind and willing to listen to your concerns or issues. Better yet, your assignment is always ready before the time, they usually send you a draft to double-check before they finalize your paper.
A popular diversion in the United States, “word find” (or “word
search”) puzzles ask the player to find each of a given set of words in a square table filled with single letters. A word can read horizontally (left or right), vertically (up or down), or along a 45 degree diagonal (in any of the four directions) formed by consecutively adjacent cells of the table; it may wrap around the table’s boundaries, but it must read in the same direction with no zigzagging. The same cell of the table may be used in different words, but, in a given word, the same cell may be used no more than once. Write a computer program for solving this puzzle.
Trying to write it java first and then pseudo code. Need help.
public class WordSearch {
private static ArrayList board = new ArrayList()
private static Scanner scanner
public static void readBoard() {
while (true) {
line = input next line
if (line equals NULL)
exit from loop
Delete all spaces in line, convert to Uppercase and add to board } }
public static void printBoard() {
rows = getRows();
for (row=0 to rows)
print board.get(row); }
public static int getRows() {
return the number of rows }
public static int getCols() {
return the number of columns }
public static void createScanner() {
try {
scanner = new Scanner(new java.io.File(“WordSearchInput.txt”)); }
catch (Exception e) {
exit from program } }
public static void processWords() {
while (scanner has a next word) {
word = scanner.next();
findWord(word); }
public static void findWord(String word) {
rows = get the number of rows
cols = get the number of columns
for (row=0 to rows)
for (col=0 to cols)
findWord(word,row,col); }
public static void findWord(String word, int row, int col) {
for (drow=-1 to 1)
for (dcol=-1 to 1)
findWord(word,row,col,drow,dcol); }
public static void findWord(String word, int row, int col, int drow, int dcol) {
rows = get the number of rows
cols = get the number of columns
for (offset=0 to word.length) {
targetRow = row + offset*drow;
targetCol = col + offset*dcol;
if ((targetRow is less than 0) OR
(targetRow is greater than equal to rows) OR
(targetCol is less than 0) OR
(targetCol is greater than equal to cols))
return
boardChar = board.get(targetRow).charAt(targetCol);
wordChar = word.charAt(offset);
if (boardChar not equal to wordChar)
// mismatch, so we’re done
return }
print (word, row, col, drow, dcol); }
public static void main(String[] args) {
createScanner();
readBoard();
printBoard();
processWords(); } }
}
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more