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

NAME

Games::Nonogram::Grid

SYNOPSIS

  use Games::Nonogram::Grid;
  my $grid = Games::Nonogram::Grid->new( height => 10, width => 10 );

    or

  my $grid = Games::Nonogram::Grid->new_from( file => 'puzzle.dat' );

DESCRIPTION

This is used internally to provide the puzzle grid.

METHODS

new

creates an object. You should provide height and width of the puzzle as shown above.

new_from

also creates an object but through a loader (in this case, ::Loader::File).

load

parses data from the loader and prepares clues.

as_string

returns (or dumps) the stringified form of the grid.

update

looks through the grid and takes a step forward to solve.

answers

returns all the answer(s) found.

ACCESSORS

rows

returns all the row clues for the grid.

cols

returns all the column clues for the grid.

clues

returns all the clues for the grid.

row

returns clues in the given row.

col

returns clues in the given column.

is_dirty

is a flag which should be true after something is changed.

has_answers

returns true if the grid has answer(s).

is_done

returns true if all the blocks are settled.

AUTHOR

Kenichi Ishigaki, <ishigaki at cpan.org>

COPYRIGHT AND LICENSE

Copyright 2007 by Kenichi Ishigaki

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.