The Word Ladders game is a Java application that utilizes a Graph data structure to find connections between words. By entering a starting and ending word, the program calculates the shortest path (word ladder) between these two words using either Depth-First Search (DFS) or Breadth-First Search (BFS). This application supports large datasets, making it capable of processing extensive word lists efficiently.
java -version
in your terminal or command prompt.WordLadders.java
and any required word list files.Compile and run the application using the Java compiler and runtime environment:
javac WordLadders.java
java WordLadders
Alternatively, you can simply run the file(s) directly in your IDE, if supported.
Upon execution, the program prompts you to enter the filename of your desired word list. Valid filenames include Length3WordGraph
or LargeWordGraph
, although you can use any text file formatted according to the program’s specifications.
After loading the word graph, follow the on-screen instructions to input your starting and ending words, and select the search algorithm (DFS or BFS).
The program expects word list files to be formatted as follows:
word1 neighbor1 neighbor2 ...
word2 neighbor1 neighbor2 ...
...
Each line represents a word and its immediate neighbors (words differing by one letter). The program reads these files to construct the word graph used to find word ladders.
Contributions to enhance the functionality or performance of the Word Ladders game are welcome. Please feel free to fork the repository, make your changes, and submit a pull request detailing your improvements.
This project is open-source and available under the MIT license.
For any inquiries or contributions, please contact the repository owner, Son Nguyen.
Created with ❤️ by Son Nguyen in 2023.