only java program, a word search puzzle, where one is presented with a grid of letters and needs to find a word by choosing adjacent letters, is the Knight-move word search puzzle, where you’re presented with a grid of letters and need to find a word in a configuration where adjacent letters in the word are reachable by moving like a knight in chess. A knight in chess moves from its current spot by either two rows and one column, or two columns and one row, in any direction. So, the knight at position "K" in the table below, can move to any of the spaces labeled "X" Write a java program that tries to find a word in a grid of letters where each letter is connected to the next by a knight move. Some specific puzzle rules: •You can never "wrap around" any edge of the grid •You can never use the same letter twice. There will be several input instances from a data file. Each input will begin with values r and c (both ≤ 8), denoting the dimensions of the grid. Values of r or c of 0 signify the end of input. Otherwise, there will follow r rows of c characters, one row per line. Each character on the line will be separated by a space, and each character will be an upper-case letter. After the grid, there will be a string of ≤ 8 upper-case letters, which is the word to look for in the grid. For each input instance i, output to the screen either:            Grid i: Word found or            Grid i: Word not found as appropriate. The program must use recursion for full credit. Refer to the sample output below. Sample File: (knight.txt ) (this is the file come with programs) 5 5 A B C D E F T H I J K O E N O S Q R S T U T N X Y CONTEST 5 6 W A B W C E F G O H I W O P A C R X J R K L M N D W O A B Q WORD 0 0 Sample Run: Enter the file name: knight.txt Grid 1: Word found Grid 2: Word not found

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

only java program, a word search puzzle, where one is presented with a grid of letters and needs to find a word by choosing adjacent letters, is the Knight-move word search puzzle, where you’re presented with a grid of letters and need to find a word in a configuration where adjacent letters in the word are reachable by moving like a knight in chess. A knight in chess moves from its current spot by either two rows and one column, or two columns and one row, in any direction. So, the knight at position "K" in the table below, can move to any of the spaces labeled "X"

Write a java program that tries to find a word in a grid of letters where each letter is connected to the next by a knight move. Some specific puzzle rules:

•You can never "wrap around" any edge of the grid

•You can never use the same letter twice.

There will be several input instances from a data file. Each input will begin with values r and c (both ≤ 8), denoting the dimensions of the grid. Values of r or c of 0 signify the end of input. Otherwise, there will follow r rows of c characters, one row per line. Each character on the line will be separated by a space, and each character will be an upper-case letter. After the grid, there will be a string of ≤ 8 upper-case letters, which is the word to look for in the grid.

For each input instance i, output to the screen either:

           Grid i: Word found or

           Grid i: Word not found as appropriate.

The program must use recursion for full credit. Refer to the sample output below.

Sample File: (knight.txt ) (this is the file come with programs)

5 5

A B C D E

F T H I J

K O E N O

S Q R S T

U T N X Y

CONTEST

5 6

W A B W C E

F G O H I W

O P A C R X

J R K L M N

D W O A B Q

WORD

0 0

Sample Run:

Enter the file name: knight.txt

Grid 1: Word found

Grid 2: Word not found

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY