NAME Games::Go::SimpleBoard - represent a simple go board SYNOPSIS use Games::Go::SimpleBoard; DESCRIPTION Please supply a description ) EXPORTED CONSTANTS Marker types for each board position (ORed together): MARK_TRIANGLE # triangle mark MARK_SQUARE # square mark MARK_CIRCLE # circle mark MARK_SMALL_B # small stone, used for scoring or marking MARK_SMALL_W # small stone, used for scoring or marking MARK_B # normal black stone MARK_W # normal whit stone MARK_GRAYED # in conjunction with MARK_[BW], grays the stone MARK_LABEL # a text label MARK_HOSHI # this is a hoshi point (not used much) MARK_MOVE # this is a regular move MARK_KO # this is a ko position MARK_REDRAW # ignored, can be used for your own purposes COLOUR_BLACK # used for $board->{last} COLOUR_WHITE # to mark the colour of the last move METHODS my $board = new $size Creates a new empty board of the given size. "$board->{max}" stores the maximum board coordinate (size-1). "$board->{captures}[COLOUR]" stores the number of captured stones for the given colour. "$board->{last}" stores the colour of the last move that was played. "$board->{board}" stores a two-dimensional array with board contents. $hint = $board->update ([update-structure...]) Structure is [$x, $y, $clr, $set, $label, $hint] # update or move [] # pass and changes the board or executes a move, by first clearing the bits specified in $clr, then setting bits specified in $set. If $set includes "MARK_LABEL", the label text must be given in $label. This function modifies the hint member of the specified path to speed up repeated board generation and updates with the same update structures. If the hint member is a reference the scalar pointed to by the reference is updated instead. Example, make two silly moves: $board->update ([[0, 18, -1, MARK_B|MARK_MOVE], [0, 17, -1, MARK_W|MARK_MOVE]); $board->is_valid_move ($colour, $x, $y[, $may_suicide]) Returns true if the move of the given colour on the given coordinates is valid or not. AUTHOR Marc Lehmann SEE ALSO KGS::Protocol, KGS::Game::Tree, Gtk2::GoBoard.