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

NAME

Games::Sudoku::Component::Table

SYNOPSIS

  use Games::Sudoku::Component::Table;

  # Let's create a default (9x9) table.

  my $t = Games::Sudoku::Component::Table->new;

  $t->

DESCRIPTION

METHODS

new (hash or hashref)

Creates an object. Options are:

size

Specifies the size of a puzzle board (table). The default is 9. Actually this value is assumed to be a square of another integer.

block_width
block_height

Specify the width/height of internal blocks, respectively. (block_width x block_height = size)

cell (row, column)

Returns the specified cell object (Games::Sudoku::Component::Table::Cell).

cells

Returns all the cell objects. Mainly used in foreach loops.

check_tmpvalue

Checks permissions and if there are any values stored temporarily but allowed now, store them again as real values.

clear

Clears all the values.

find_all

Finds all the cells that have least value possibilities.

find_next

Finds a cell that have least value possibilities.

is_finished

Returns true if all the cells have a real value.

num_of_finished

Returns a number of the cells that have a real value.

lock_all

Locks all the cells that have a real value, mainly to protect the generated or loaded puzzle, so that players cannot, intentionally or unintentionally, change it.

unlock_all

Unlocks the cells. Use before creating or loading a new puzzle.

as_string

Returns a loadable set of strings for the puzzle.

as_HTML

Returns an HTML table for the puzzle.

SEE ALSO

Games::Sudoku::Component
Games::Sudoku::Component::Table::Cell
Games::Sudoku::Component::Table::Item
Games::Sudoku::Component::Table::Permission

AUTHOR

Kenichi Ishigaki, <ishigaki@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Kenichi Ishigaki

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