I need help with this program in Java not C++ 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

I need help with this program in Java not C++

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 3 steps with 4 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education