ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Games-Go-SimpleBoard/SimpleBoard.pm
(Generate patch)

Comparing Games-Go-SimpleBoard/SimpleBoard.pm (file contents):
Revision 1.1 by root, Sun Jun 22 15:05:59 2008 UTC vs.
Revision 1.2 by root, Mon Jun 23 00:38:35 2008 UTC

129 } 129 }
130 130
131 @found 131 @found
132} 132}
133 133
134=item $hint = $board->update ([update-structure...]) 134=item $hint = $board->update ([update-structures...])
135 135
136Structure is 136Each update-structure itself is also an array-ref:
137 137
138 [$x, $y, $clr, $set, $label, $hint] # update or move 138 [$x, $y, $clr, $set, $label, $hint] # update or move
139 [] # pass 139 [] # pass
140 140
141and changes the board or executes a move, by first clearing the bits 141It changes the board or executes a move, by first clearing the bits
142specified in C<$clr>, then setting bits specified in C<$set>. 142specified in C<$clr>, then setting bits specified in C<$set>.
143 143
144If C<$set> includes C<MARK_LABEL>, the label text must be given in 144If C<$set> includes C<MARK_LABEL>, the label text must be given in
145C<$label>. 145C<$label>.
146 146
147This function modifies the hint member of the specified path to speed up 147This function modifies the hint member of the specified path to speed up
148repeated board generation and updates with the same update structures. 148repeated board generation and updates with the same update structures.
149 149
150If the hint member is a reference the scalar pointed to by the reference 150If the hint member is a reference the scalar pointed to by the reference
151is updated instead. 151is updated instead.
152
153If all this hint member thing is unclear, just ignore it and specify it
154as C<undef> or leave it out of the array entirely. Do make sure that you
155keep your update structures around, however, as regenerating a full board
156position from hinted update structures is I<much> faster then recreating
157it from fresh update structures.
152 158
153Example, make two silly moves: 159Example, make two silly moves:
154 160
155 $board->update ([[0, 18, -1, MARK_B|MARK_MOVE], 161 $board->update ([[0, 18, -1, MARK_B|MARK_MOVE],
156 [0, 17, -1, MARK_W|MARK_MOVE]); 162 [0, 17, -1, MARK_W|MARK_MOVE]);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines