1. Computing

Boggle Generator

Fancy Delphi Application Contest Entry #19 by Adi Andrei


Boggle Generator - Fancy Delphi Application Contest Entry #19

Boggle Generator - Fancy Delphi Application Contest Entry #19

Boggle game is played using a grid of lettered dice, in which players attempt to find words in sequences of adjacent letters.

A great idea for the Fancy Delphi Application Contest ;-)


Genetic Algorithms (GAs) are adaptive heuristic search algorithms based on the idea of evolution, genetics and natural selection. They employ a population of individuals that undergo selection in the presence of variation-inducing operators such as mutation and recombination (crossover). A fitness function is used to evaluate individuals, and reproductive success varies with fitness. From generation to generation an improvement of the maximum fitness is usually being observed.

The Boggle Algorithm:

  1. Randomly generate an initial population M(0)
  2. Compute and save the fitness u(m) for each individual m in the current population M(t)
  3. Define selection probabilities p(m) for each individual m in M(t) so that p(m) is proportional to u(m)
  4. Generate M(t+1) by probabilistically selecting individuals from M(t) to produce offspring via genetic operators
  5. Repeat step 2 until satisfying solution is obtained.
The problem to solve in this Delphi example is to generate a 5x5 Boggle table with as high a score as possible, given a certain dictionary.

In Boggle, words that can be constructed from the letters of sequentially adjacent cells in a grid, where "adjacent" cells are those horizontally, vertically or diagonally neighboring. Words must be at least three letters long, may include singular and plural (or other derived forms) separately, but may not use the same cell more than once per word.

The interface is pretty self-explanatory. To run it just click 'Start'. The 'best' solution at any time is always displayed in the table on the upper left side.

"Boggle" was submitted by Adi Andrei.

Do you have a FDA(C)? Submit your Delphi code to the Fancy Delphi Application Contest.

©2014 About.com. All rights reserved.