This program is responsible to find the word from given list in the cross word puzzle in all possible 8 directions. The structure of the project is as follows:
-
input: A directory consists of various crossword puzzle
.txt
files with respective word dictionaries in.txt
format which serves as an input to the driver class. -
CrossWordSolver.py: It is a
python script
which consist of the class by the same name which responsible for setting up the crossword puzzle and search for words present in the word dictionary. The results are shown to the user as a console output. -
main.py: A python script which consist of the mail function which reads the puzzle and word dictionary file provided by the input and create an object of
CrossWordSolver
class to execute the word search.
Following are the assumptions that are taken into account while developing a project:
-
Crossword puzzles and word dictionary would be read from the
.txt
files fo simplicity of input operation of the program. -
Each row of the crossword puzzle should be present in the single row without any space between the characters.
-
Similarly, in word dictionary file only single words should be written in each line.
-
The program can read crossword puzzle of various sizes.
-
Words with
length < 3
would be ignored by the program as per the given requirement.
-
On the local machine clone the github repository using command:
git clone https://github.com/anmolsrivastava97/CrossWord-Solver.git
-
main.py
is the driver class which requires two input arguments i.e.-puzzle_path
and-word_dictionary_path
-
After choosing the appropriate crossword puzzle and word dictionary file pass the command :
python3 main.py input/puzzle_1.txt input/words.txt
-
In the above command path arguments can be changed based on local path of crossword puzzle text and word test file.
All the text files are available in input
folder
-
bigPuzzle.txt
andbigWords.txt
-
exceptionPuzzle.txt
andwords_1.txt
(For testing exception while reading file) -
puzzle_1.txt
andwords_1.txt
-
puzzle_2.txt
andwords_2.txt
-
puzzle_3.txt
andwords_3.txt