… | |
… | |
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 | |
136 | Structure is |
136 | Each 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 | |
141 | and changes the board or executes a move, by first clearing the bits |
141 | It changes the board or executes a move, by first clearing the bits |
142 | specified in C<$clr>, then setting bits specified in C<$set>. |
142 | specified in C<$clr>, then setting bits specified in C<$set>. |
143 | |
143 | |
144 | If C<$set> includes C<MARK_LABEL>, the label text must be given in |
144 | If C<$set> includes C<MARK_LABEL>, the label text must be given in |
145 | C<$label>. |
145 | C<$label>. |
146 | |
146 | |
147 | This function modifies the hint member of the specified path to speed up |
147 | This function modifies the hint member of the specified path to speed up |
148 | repeated board generation and updates with the same update structures. |
148 | repeated board generation and updates with the same update structures. |
149 | |
149 | |
150 | If the hint member is a reference the scalar pointed to by the reference |
150 | If the hint member is a reference the scalar pointed to by the reference |
151 | is updated instead. |
151 | is updated instead. |
|
|
152 | |
|
|
153 | If all this hint member thing is unclear, just ignore it and specify it |
|
|
154 | as C<undef> or leave it out of the array entirely. Do make sure that you |
|
|
155 | keep your update structures around, however, as regenerating a full board |
|
|
156 | position from hinted update structures is I<much> faster then recreating |
|
|
157 | it from fresh update structures. |
152 | |
158 | |
153 | Example, make two silly moves: |
159 | Example, 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]); |