The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Games::Trackword - Find words on a Trackword grid.

SYNOPSIS

  use Games::Trackword;

  my $board = Games::Trackword->new('TRA WKC ORD');

  foreach my $word (@wordlist) {
    print "OK $word\n" if $board->has_word($word);
  }

DESCRIPTION

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.

METHODS

new
  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');
qu
  $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.

has_word
  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).

BUGS, PATCHES & FIXES

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 dependent upon their severity and my availability. 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

ACKNOWLEDGEMENTS

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.

AUTHOR

  Barbie, <barbie@cpan.org>
  for Miss Barbell Productions <http://www.missbarbell.co.uk>.

COPYRIGHT

  Copyright (C) 2003-2014 Barbie for Miss Barbell Productions.

  This distribution is free software; you can redistribute it and/or
  modify it under the Artistic License 2.0.