Games::Trackword - Find words on a Trackword grid.
use Games::Trackword; my $board = Games::Trackword->new('TRA WKC ORD'); foreach my $word (@wordlist) { print "OK $word\n" if $board->has_word($word); }
This module lets you set up a Trackword grid and query whether or not it is possible to find words on that grid.
Note that although Trackword is similar to Boggle, you are not restricted by the size of the grid and you cannot move diagonally between each letter, you may only move up/down or left/right.
my $board = Games::Trackword->new('TRA WKC ORD'); # TRA # WKC # ORD
You initialize the board with a series of letter blocks representing the letters that are shown on the grid. Spaces (or non alphabetics) may be inserted to make the board string more readable.
Grids bigger than 3x3, are simply represented by long strings separated by spaces:
my $board4 = Games::Trackword->new('TRAC ROWK DTR WKCA'); my $board5 = Games::Trackword->new('TRACK TDROW RACKW RTDRO ACKWO');
$board->qu(); # Boggle rules $board->qu(0); # Trackword rules (default)
Use if 'Qu' should be represented as a 'Q' (as per Boggle). In this instance words containing the letter Q should be entered in full ('Queen', rather than 'qeen'). Note that in Boggle words containing a 'Q' not immediately followed by a 'U' are never playable.
print "OK $word\n" if $board->has_word('tithe'); print "NOT OK $word\n" unless $board->has_word('queen');
Given any word, we return whether or not that word can be found on the board following the normal rules of Trackword (and Boggle).
By its very nature the size of grid is the only limiting factor of this module. If you can create a grid that is too large to fit in memory, the author recommends that you not to do that!
There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties that are not explained within the POD documentation, please submit a bug to the RT system (see link below). However, it would help greatly if you are able to pinpoint problems or even supply a patch.
Fixes are dependant upon their severity and my availablity. Should a fix not be forthcoming, please feel free to (politely) remind me by sending an email to barbie@cpan.org .
RT: http://rt.cpan.org/Public/Dist/Display.html?Name=Games-Trackword
The original idea for this came from my disappointment that Tony Bowden's Games::Boggle module couldn't handle Trackword style grids (typically 3x3) and bigger, and also forced the use of Qu rather Q & U. Much of the code here steals from Tony's module.
See Games::Boggle if you want a traditional Boggle rules module.
R - Released d - Developer p - Perl only O - Object oriented p - Standard Perl
Barbie, <barbie@cpan.org> for Miss Barbell Productions <http://www.missbarbell.co.uk>.
Copyright © 2003-2007 Barbie for Miss Barbell Productions. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, using the Artistic License.
The full text of the licenses can be found in the Artistic file included with this distribution, or in perlartistic file as part of Perl installation, in the 5.8.1 release or later.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '©'. Assuming CP1252
To install Games::Trackword, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Trackword
CPAN shell
perl -MCPAN -e shell install Games::Trackword
For more information on module installation, please visit the detailed CPAN module installation guide.