Games-Crossword-Puzzle
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Games/Crossword/Puzzle.pm view on Meta::CPAN
#pod my $puzzle = Games::Crossword::Puzzle->from_file($filename);
#pod
#pod This method reads in a puzzle file and returns a puzzle object. It will raise
#pod an exception if the file does not appear to be a valid puzzle file.
#pod
#pod =cut
sub from_file {
my ($class, $filename) = @_;
my $self = bless {} => $class;
open my $fh, $filename or die "couldn't open file: $!";
seek $fh, 2, 0;
read $fh, (my $magic), 12;
die "file is not a valid puzzle" unless $magic eq "ACROSS&DOWN\0";
{
seek $fh, 0x2C, 0;
read $fh, (my $size), 2;
lib/Games/Crossword/Puzzle/Cell.pm view on Meta::CPAN
#pod
#pod =cut
sub new {
my ($class, $arg) = @_;
my $data = {
map { $_ => $arg->{$_} } qw(across down number value guess)
};
bless $data => $class;
}
#pod =method across
#pod
#pod =method down
#pod
#pod These methods return the clues for the word beginning in this cell, if any.
#pod
#pod =cut
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.834 second using v1.00-cache-2.02-grep-82fe00e-cpan-a086c87fca4 )