Games::JumbleCreator - Create Jumble word puzzles.


NAME

Games::JumbleCreator - Create Jumble word puzzles.


SYNOPSIS

  use Games::JumbleCreator;
  my $jumble = Games::JumbleCreator->new();
  $jumble->num_words(6);
  $jumble->dict('/home/doug/crossword_dict/unixdict.txt');
  my @jumble = $jumble->create;
  foreach my $word (@jumble) {
    print "$word\n";
  }
  my @good_words = $jumble->solve('rta');
  if (@good_words) {
    foreach my $good_word (@good_words) {
      print "$good_word\n";
    }
  } else {
    print "No words found\n";
  }


DESCRIPTION

Games::JumbleCreator is used to create Jumble word puzzles. Games::JumbleCreator can also solve jumbled words.


OVERVIEW

TODO


CONSTRUCTOR

new ( NUMBER_OF_WORDS );
This is the constructor for a new Games::JumbleCreator object. If NUMBER_OF_WORDS is passed, this method will set the number of words for the puzzle.


METHODS

num_words ( [ NUMBER_OF_WORDS ] )
If NUMBER_OF_WORDS is passed, this method will set the number of words for the puzzle. The default value is 5. The number of words is returned.

dict ( [ PATH_TO_DICT ] )
If PATH_TO_DICT is passed, this method will set the path to the dictionary file. Dictionary file must have one word per line. The default value is /usr/dict/words. The path to the dictionary file is returned.

create ( )
Method that creates the jumble. Returns array containing words (normal and jumbled).

solve ( WORD )
This method will solve a jumbled word. Returns array containing valid words.


AUTHOR

Doug Sparling, doug@dougsparling.com


COPYRIGHT

Copyright (c) 2001 Douglas Sparling. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

 Games::JumbleCreator - Create Jumble word puzzles.