Imagine a grid with 16 letters arranged in a 4x4 board. Each letter is uniquely positioned, where [2,1] points to the letter in the third row and second column.
const coordPairs = [
[ [2, 1], [4, 1] ]
[ [4, 0], [4, 1], [4, 2], [4, 3] ]
[ [0, 0], [0, 1], [0, 2] ],
[ [1, 0], [3, 0], [4, 0] ]
]
I am currently pondering on how to associate each pair like [2,1] with a specific letter on the game board represented by an array of 16 strings (letters).
The ultimate goal is for a function to generate words based on the coordinates you input and the arrangement of letters on the game board.
If you would like to view the code with detailed comments, visit this JSFiddle link: https://jsfiddle.net/8euxzgy2/4/