ANN: BoggleSolver now on sample stacks
Alex Tweedly
alex at tweedly.net
Sun Jan 2 18:42:09 EST 2022
I've put a little 'game' up on "sample stacks", and also on the web.
It "solves" Boggle style puzzles, i.e. you give it a 5x5 grid of
letters, and it finds all words within it, following the prescribed
rules - words are formed by moving to adjacent (including diagonal) grid
positions, and you cannot re-use a grid position within a word. You can
modify the input field, and click on "Solve it" to see the new results.
The list of words is that used by Jacqueline in her JQBoggle game.
The UI is very basic - but there is one clever (I think) thing within
it. It uses a dictionary of words which is a hierarchical
character-by-character array, so it represents not only "what is a word"
but also "what can be the initial substring of a word", and therefore it
can prune the search tree immediately. This takes the time to solve a
puzzle down from approx 10 - 50 minutes using a simple dictionary, to
around 40 millisecs.
NB I have also built a Web-based standalone version of it using 10.0.0
(dp1), which can be found at
https://www.tweedly.org/BoggleSolver/BoggleSolver.html
Note - the "Load URL ..." portion does not yet work in the web version.
Loading is fairly slow, but the run times re (IMHO) impressive - 80msecs
against the 40msecs or so running in the IDE. I am very impressed by the
performance of this early web implementation.
Having a 'solver' like this opens up possible new games such as:
1. given we have 25 grid positions, and 25 letters (omitting 'Q'), what
arrangement of letters gives the most, or least, words.
2. given a random selection of letters, what arrangement gives
most/least words.
3. (a 2-player game) given an arrangement of letters, change one letter
and increase the number of words that can be formed; score the value of
the increase (or decrease), playing alternately, until neither player
can get a positive score change.
Alex.
More information about the use-livecode
mailing list