-
-
30 Jun 2007 21:08:45 UTC
- Distribution: Games-Jumble
- Module version: 0.09
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (497 / 0 / 1)
- Kwalitee
Bus factor: 0- 11.44% Coverage
- License: unknown
- Activity
24 month- Tools
- Download (12.95KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Test::More
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Games::Jumble - Create and solve Jumble word puzzles.
VERSION
Version 0.09
SYNOPSIS
use Games::Jumble; my $jumble = Games::Jumble->new(); $jumble->set_num_words(6); $jumble->set_word_lengths_allowed(5,6); $jumble->set_word_lengths_not_allowed(7,8); $jumble->set_dict('/home/doug/crossword_dict/unixdict.txt'); my @jumble = $jumble->create_jumble; foreach my $word (@jumble) { print "$word\n"; } # Solve jumbled word my @good_words = $jumble->solve_word('rta'); if (@good_words) { foreach my $good_word (@good_words) { print "$good_word\n"; } } else { print "No words found\n"; } # Create jumbled word my $word = 'camel'; my $jumbled_word = $jumble->jumble_word($word); print "$jumbled_word ($word)\n";
DESCRIPTION
Games::Jumble
is used to create and solve Jumble word puzzles.Currently
Games::Jumble
will create random five- and six-letter jumbled words from dictionary. Future versions ofGames::Jumble
will allow user to create custom jumbles by using a user defined word file with words of any length. Individual words of any length may be jumbled by using thejumble_word()
method.Default number of words is 5. Default dictionary is '/usr/dict/words'. Dictionary file must contain one word per line.
new
This is the constructor for a new Games::Jumble object.
my $jumble = Games::Jumble->new();
If
num_words
is passed, this method will set the number of words for the puzzle, otherwise number of words is set to default value of 5.my $jumble = Games::Jumble->new(num_words=>$num_words);
set_word_lengths_allowed ( length1 [, length2, length3,...] )
If
lengthx
is(are) passed, this method will set word lengths that will be used when creating jumble. The default setting will use all word lengths. Note: Allow all is designated by empty hash.set_word_lengths_not_allowed ( length1 [, length2, length3,...] )
If
lengthx
is(are) passed, this method will set word lengths that will be skipped when creating jumble. The default setting will not skip any word lengths. Note: Skip none is designated by empty hash.create_jumble
This method creates the jumble.
jumble_word ( WORD )
This method will create a jumbled word. Returns scalar containing jumbled word.
solve_word ( WORD )
This method will solve a jumbled word. Returns list of solved words.
solve_crossword ( WORD )
This method will solve an incomplete word as needed for a crossword. WORD format: 'c?m?l' where question marks are used a placeholders for unknown letter. Returns list of solved words.
AUTHOR
Doug Sparling,
<usr_bin_perl at yahoo.com>
BUGS
Please report any bugs or feature requests to
bug-games-jumble at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Jumble. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Games::Jumble
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
RT: CPAN's request tracker
Search CPAN
ACKNOWLEDGEMENTS
Tim Maher for pointing out some outdated documentation in the Synopsis.
COPYRIGHT & LICENSE
Copyright 2001-2007 Doug Sparling, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Module Install Instructions
To install Games::Jumble, copy and paste the appropriate command in to your terminal.
cpanm Games::Jumble
perl -MCPAN -e shell install Games::Jumble
For more information on module installation, please visit the detailed CPAN module installation guide.