Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program to solve word searching puzzles - the puzzle itself is in puzzle.txt file and the list of words to be found can
Write a program to solve word searching puzzles - the puzzle itself is in puzzle.txt file and the list of words to be found can be matched in the dictionary.txt file. Your program is to find the words from dictionary.txt file that are present in the puzzle.txt file by starting at any character and having the word present in a straight line either horizontally or vertically (left, right, up, down). puzzle.txt is delimited by spaces and dictionary.txt contains one word for each line, both the files are uploaded at the end. The program is to read both the puzzle.txt and dictionary.txt as input. The output must contain the list of words that are present in the puzzle.txt that match with the words in the dictionary.txt file and the output MUST be written to another file named output.txt The program will be using only the following libraries: File - to read and write a file Arrays/Strings - to store the input data PrintWriter/BufferedWriter - to write to a file PrintReader/Buffered Reader - to read from a file No other collection libraries should be used in the program. Example input.txt file contents: RWORCAH SIFRIDB REYI ADINO OED D G CSN OOR RHVEDABTITEV CE CRNIH PLODE ASEN GOHEGDEHP CRHHN DGRMIEESBATUIT Example output.txt file contents: AARDVARK BADGER BAT CROCODILE CROW DINOSAUR DOLPHIN EEL FISH HEDGEHOG MOLE OSTRICH Assumptions: 1. It can be assumed that both the puzzle.txt and dictionary.txt files are present in the same directory as your source code. 2. The dictionary.txt file contains words of 3 or more letters in lexicographic order. 3. txt file will contain characters delimited by spaces with at-least 3 rows and 3 columns. 4. All rows in the puzzle.txt file will be of same length. 5. All columns in the puzzle.txt file will be of same length. 6. It can be assumed that the puzzle.txt and dictionary.txt file will contain uppercase letters only. Files to submit: Word Search.java Readme.txt (Optional) Note: The puzzle.txt might contain words in a diagonal order as well, those words can be ignored. Given the right strategy used, the program should not take more than 150 lines of code. File and the usage of file libraries are covered in Week 4. puzzle txt dictionary.txt
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started