Games::Word - utility functions for writing word games
version 0.06
use Games::Word; print "permutation!\n" if is_permutation 'word', 'orwd'; my $mm_solution = random_string_from "abcdefgh"; my $mm_guess = <>; chomp $mm_guess; my $mm_correct_letters = shared_letters $mm_solution, $mm_guess; my $mm_correct_positions = shared_letters_by_position $mm_solution, $mm_guess;
Games::Word provides several utility functions for writing word games, such as manipulating permutations of strings, testing for similarity of strings, and finding strings from a given source of characters.
Returns a string which is a random permutation of the letters in STRING.
Returns true of STRING1 is a permutation of STRING2, and false otherwise.
Returns a list containing all permutations of the characters in STRING.
Returns a list of the characters that STRING1 and STRING2 have in common, ignoring their position in the string.
In list context, returns a list that is the length of the larger of STRING1 and STRING2, which contains the character at that position in both strings if they are the same, and undef otherwise.
In scalar context, returns the number of characters that are the same in both value and position between STRING1 and STRING2.
Uses STRING as an alphabet to generate a random string of length LENGTH. Characters in STRING may be repeated.
Returns true if SUBSTRING consists of only characters from STRING, in order. For example, 'word' is a substring of 'awobbrcd', but not of 'dcrbbowa' or 'awbbrcd'.
Returns a list of all substrings (see is_substring) of STRING.
Returns true if SUBSTRING is a subpermutation (like is_substring, but without caring about order) of STRING, and false otherwise.
Like all_substrings, except using is_subpermutation instead.
No known bugs.
Please report any bugs through RT: email bug-games-word at rt.cpan.org, or browse http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Games-Word.
bug-games-word at rt.cpan.org
Games::Word::Wordlist
You can find this documentation for this module with the perldoc command.
perldoc Games::Word
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Games-Word
CPAN Ratings
http://cpanratings.perl.org/d/Games-Word
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Games-Word
Search CPAN
http://search.cpan.org/dist/Games-Word
Jesse Luehrs <doy at tozt dot net>
This software is copyright (c) 2012 by Jesse Luehrs.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Games::Word, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Games::Word
CPAN shell
perl -MCPAN -e shell install Games::Word
For more information on module installation, please visit the detailed CPAN module installation guide.