Create an applet that mimics the game Boggle.
There are 16 dice with letters on each side of each die. The dice are shaken and then fall into 16 slots in 4 rows and 4 columns on the game board. The players then have 3 minutes to write down as many words of 3 or more letters as they can. The words must have the letters adjacent to each other either horizontally, vertically or diagonally. No letter cube can be used more than once in a single word. Proper names and abbreviations are not permitted. The players should agree upon a standard dictionary and accept doubtful words only if they are in that dictionary. At the end of 3 minutes the players compare their words. Any words that any other player has also made receive no points. Unique words receive 1 point for 3- or 4-letter words, 2 points for 5-letter words, 3 points for 6-letter words, 5 points for 7-letter words and 11 points for words of 8 or more letters. Play continues until a player has reached 50 points or more. That player wins.
The Boggle dice are given below. You will create these dice with a two-dimensional array of Strings. The first dimension will hold the number of the die and the second will hold the number of the letter on that die So Dice[ 0 ] [ 2 ] = F means the letter on the first die and the third side of that die is F. It is important to follow instructions EXACTLY to the specifications of this project.
Boggle Dice See image.
Then create a one-dimensional array to hold the value that will be assigned to each die. This will also be a String array. Assign values to this array using a loop. For each die, 0 - 15, assign a random number, 0 - 5, to its second dimension. This selects one face of the die. So for example the first die might have the random number 4. That means Dice[ 0 ] [ 4 ] which is B will be assigned to the one-dimensional array’s 0 position. After the loop is finished all the values in the one-dimensional array will have been randomly selected. All of this should be done in the init method.
In the paint method, you will need to first put the name Boggle and brief directions at the top. Then you will need to draw the 4-by-4 board and display the values that you have randomly assigned to the 16 positions. Make sure to set a readable font and have everything centered and aligned nicely.
This is what is required for this project, but it doesn’t really mimic the game accurately.