NAME

WordFind - Class for generating Word Find type puzzles


SYNOPSIS

    use Games::WordFind;
    $puz=Games::WordFind->new({cols=>10});
    @words=qw(perl camel llama linux great);
    $puz->create_puzzle(@words);
    print $puz->get_plain();
    
    or,
    print $puz->get_latex();


DESCRIPTION

This module simply provides a class which can be used to generate WordFind type puzzles. It is simple to use, the relevant methods are:

$puzzle = Games::WordFind->new({OPTIONS});
Returns a WordFind object with a default size of 10x10.

OPTIONS:
$puzzle->create_puzzle(LIST)
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.

$puzzle->get_plain({solution => 1})
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.

$puzzle->get_latex({solution => 1, wrapper => 1})
This method creates 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.

$puzzle->get_html({solution =>1, wrapper =>1})
Similar to the latex method, though, of course, there is no newpage separation of the solution.


AUTHOR

Andrew L Johnson <ajohnson@cpan.org>


Copyright

WordFind.pm and wordfind.pl are copyright (c) 1997-2002 Andrew L Johnson. This is free software and you may redistribute it and/or modify it under the same terms as Perl itself.


Credits

Rob Duarte submitted patches that eventually led to the only and no options.


SEE ALSO

perl(1).