Boggle
The Game
Boggle is a word game designed by Allan Turoff. The objective of the game is to construct as many different words as you can from a grid of letters. You can use letters (in positions) that are next to each other – above, below, left, right, diagonal but you can not use the same letter more than once. Each word must be defined in a dictionary. Points are assigned according to the length of the word.
The source code attached here is an implementation of this game in Java. It demonstrates recursion to solve problems like this game. The program attempts to construct words as defined in dic.txt from puzzle.txt. Points are assigned according to the length of the word.
Instructions
To run this program you need JDK 5 or better installed. You can get JDK from here.
- Unzip the file. This creates a folder called
Boggle - Compile the code:
javac src\*.java -d bin - Run the program:
java -classpath bin Boggle
C:\Boggle>javac src\*.java -d bin
C:\Boggle>java -classpath bin Boggle
Enter boggle file:
puzzle.txt
Opened puzzle.txt
Enter dictionary name:
dic.txt
Opened dic.txt
Reading files...
Solving...
Word | Points | Path
----------------+--------+-----------------------
APR | 1 | [(0,0), (0,1), (0,2)]
APRTOCFED | 15 | [(0,0), (0,1), (0,2), (1,2), (1,1), (1,0), (2,0), (2,1), (2,2)]
COT | 1 | [(1,0), (1,1), (1,2)]
FED | 1 | [(2,0), (2,1), (2,2)]








Leave your response!