NAME

Games::Nonogram::Clue

DESCRIPTION

This is used internally to handle clues in a row or in a column.

METHODS

new

creates an object.

set

sets an array of the length of clues in a row/column.

reset_blocks

initializes the positions of clues. Actually this may fix them when there're no free cells, as this tries to put blocks so as not to cross each other.

as_string

returns a stringified form of the line for the clues.

dump_blocks

similar to above but returns more detailed information of the blocks of the clues.

is_done

returns if each block in the line is fixed or not.

die_if_invalid

dies if any of the blocks in the line can not have enough spaces (while brute-forcing, or when the puzzle is broken).

on

tells each block in the line that the given id (cell) should belong to one of the blocks.

off

tells each block in the line that the given id (cell) should not belong to one of the blocks.

value

returns if the given id (cell) belongs to a block or not.

might_have

returns if the given id (cell) can belong to a block or not.

update

sees through the line and turns on/off the cells it can surely tell.

candidates

returns all the possible patterns of the line.

ACCESSORS

id

returns a clue id.

blocks

returns all the blocks in the clues.

size

returns how many cells are there in a row/column for the clues.

line

returns a row/column for the clues.

block

returns a block of the given (block) id.

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.