WordFind - Class for generating Word Find type puzzles
@words=qw(perl camel llama linux great);
This module simply provides a class which can be used to generate WordFind type puzzles. It is simple to use, the relevant methods are:
Obviously, this returns a WordFind object. By default the puzzle created by this object is a 10x10 lattice---you may give an optional hash reference with a 'cols' as the key and some number as the value for the size of the lattice. You may also provide an 'intersect' key, which allows words to intersect in the puzzle (share letters) when set to a non-zero value.
This method takes the LIST of words and creates the puzzle. Any words which are longer than the number of columns in the puzzle are dropped from the wordlist and a warning is issued. This method will return references to three arrays; a two dimensional array of the puzzle, an array of the words used, and a two dimensional array of the puzzle solution. These are so you can format your puzzle output yourself rather than using the latex or html formatting functions described next.
This method gets the puzzle and its solution matrix in a plain text format. If you supply the optional hash reference with a non-zero value for 'solution', a solution matrix is included immediately following the puzzle.
This method a latex formatted version of the puzzle containing tabular environments to set the puzzle and solution (a newpage separates the two). The optional hash argument can contain the key 'wrapper' which tells the method to return the puzzle wrapped with a latex preamble, and the key 'solution' which will return the solution matrix after a \newpage command in the latex source.
Similar to the latex method, though, of course, there is no newpage separation of the solution.
Andrew L Johnson <email@example.com>
WordFind.pm and wordfind.pl are copyright (c) 1997,1998 Andrew L Johnson. This is free software and you may redistribute it and/or modify it under the same terms as Perl itself.
To install Games::WordFind, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.