Find the longest word.
A popular word game has sixteen six-sided dice. Each dice is unique with a single letter of the alphabet on each face. The dice are rolled and arranged in a 4x4 grid. The players try to create valid words using the dice. Any dice can be chosen as a starting letter, but subsequent letters must adjacent horizontally, vertically or diagonally to the previous dice. The object of the game is to find a valid word with the most letters.
The six faces of the sixteen dice can be seen in the `dice.txt` file below. It is important that the grid is stored in a 2D array for each dice position to be processed easily. The program does not need to determine who wins.
R,I,F,O,B,X
I,F,E,H,E,Y
D,E,N,O,W,S
U,T,O,K,N,D
H,M,S,R,A,O
L,U,P,E,T,S
A,C,I,T,O,A
Y,L,G,K,U,E
Qu,B,M,J,O,A
E,H,I,S,P,N
V,E,T,I,G,N
B,A,L,I,Y,T
E,Z,A,V,N,D
R,A,L,E,S,C
U,W,I,L,R,G
P,A,C,E,M,D
Write a program that reads in the faces of the sixteen dice, picks a random face from each die and outputs the letter from the face in a 4x4 grid.
Use this boilerplate code as a starting point:
Remember to add a comment before a subprogram, selection or iteration statement to explain its purpose.
BISN
ASCY
ASIT
NEUA
Use these resources as a reference to help you meet the success criteria.
Run the program several times to check that your program has met the success criteria.
Check that you have: