Boggle is played with 16 six-sided letter cubes and a 4x4 tray into which the cubes are shaken. The object is win as many points as possible by joining letters horizontally, vertically, or diagonally to form words.
Longer words win more points.
This month your Challenge is to solve a game like Boggle, with a few twists. Our first twist on the standard Boggle game is that the puzzle dimension will vary from 4x4 up to 7x7, inclusive. Your Boggle routine will provided the puzzle, a dimension x dimension array of characters. The second twist is that you are allowed to cheat, up to a point, anyway. You can cheat by picking up any of the cubes and exchanging it with any other cube.