Debian Codegraph @

texmf-dist/doc/latex/pgf-go/en/pgfgo-stones.tex

raw
1 \section{Stones, Moves, and Prisoners}
2
3 Stones are the fundamental elements. In \pgfgoname, commands and options are provided to draw them flexibly, allowing customization of their appearance and behavior according to the needs of the diagram.
4
5 \subsection{Stones}
6
7 \begin{command}{\stone\opt{\oarg{options}}\marg{intersection}}
8 This command draws an individual stone at the specified intersection. The mandatory argument is the coordinate (e.g., "C2"), while optional options allow adjusting its style, such as color, size, or markings, following the convention of the first player in Go.
9 \end{command}
10
11 \begin{command}{\stones\opt{\oarg{options}}\marg{intersection \opt{, intersection, ...}}}
12 Similar to |\stone|, but allows placing multiple stones using the corresponding syntax (see Coordinate Syntax).
13 \end{command}
14
15 It is possible to change an option for all players using |\pgfgoset{stone = {...}}|. This is equivalent to |\pgfgoset{players = {all = {stone = {...}}}}|.
16
17 \begin{key}{/pgfgo/stone/fill = \meta{option} (default true)}
18 Controls the fill options of a stone.
19 \end{key}
20
21 \begin{key}{/pgfgo/stone/fill/color = \meta{color}}
22 Defines the fill color of a stone.
23
24 \begin{codeexample}[]
25 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
26
27 \begin{goban}
28 \stones[b]{C2,D3}
29 \stone[w]{B4}
30 \end{goban}
31
32 \begin{goban}
33 \stones[fill = {color = cyan!80!black}]{C2,D3}
34 \stone[fill = {color = magenta!80!black}]{B4}
35 \end{goban}
36 \end{codeexample}
37 \end{key}
38
39 \begin{key}{/pgfgo/stone/fill/opacity = \meta{float} (initially 1)}
40
41 Controls the opacity of the stone’s fill, ranging from 0 (transparent) to 1 (opaque).
42
43 \begin{codeexample}[]
44 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
45
46 \begin{goban}
47 \stones[b]{C2,D3}
48 \stone[w]{B4}
49 \end{goban}
50
51 \begin{goban}
52 \stones[b, fill = {opacity = 0.8}]{C2,D3}
53 \stone[w, fill = {opacity = 0.5}]{B4}
54 \end{goban}
55 \end{codeexample}
56 \end{key}
57
58 \begin{key}{/pgfgo/stone/line = \meta{option} (initially true)}
59 Controls the border options of a stone.
60 \end{key}
61
62 \begin{key}{/pgfgo/stone/line/color = \meta{color} (initially black)}
63
64 Sets the border color of the stone, which is black by default for all stones.
65
66 \begin{codeexample}[]
67 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
68
69 \begin{goban}
70 \stones[b]{C2,D3}
71 \stone[w]{B4}
72 \end{goban}
73
74 \begin{goban}
75 \stones[b, line = {color = magenta}]{C2,D3}
76 \stone[w, line = {color = cyan}]{B4}
77 \end{goban}
78 \end{codeexample}
79 \end{key}
80
81 \begin{key}{/pgfgo/stone/line/opacity = \meta{float} (initially 1)}
82
83 Defines the opacity of the stone’s border, allowing it to be more subtle or transparent.
84
85 \begin{codeexample}[]
86 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
87
88 \begin{goban}
89 \stones[b]{C2,D3}
90 \stone[w]{B4}
91 \end{goban}
92
93 \begin{goban}
94 \stones[b, line = {opacity = 0.5}]{C2,D3}
95 \stone[w, line = {opacity = 0.8}]{B4}
96 \end{goban}
97 \end{codeexample}
98 \end{key}
99
100 \begin{key}{/pgfgo/stone/line/width = \meta{dimension} (initially 0.9pt)}
101
102 Controls the thickness of the stone’s border.
103
104 \begin{codeexample}[]
105 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
106
107 \begin{goban}
108 \stones[b]{C2,D3}
109 \stone[w]{B4}
110 \end{goban}
111
112 \begin{goban}
113 \stones[b]{C2,D3}
114 \stone[w, line = {width = 2pt}]{B4}
115 \end{goban}
116 \end{codeexample}
117 \end{key}
118
119 \begin{key}{/pgfgo/stone/radius = \meta{dimension} (initially 0.55em)}
120
121 Sets the size of the stone by its radius.
122
123 \begin{codeexample}[]
124 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
125
126 \begin{goban}
127 \stones[b]{C2,D3}
128 \stone[w]{B4}
129 \end{goban}
130
131 \begin{goban}
132 \stones[b, radius = 0.15cm]{C2,D3}
133 \stone[w, radius = 0.25cm]{B4}
134 \end{goban}
135 \end{codeexample}
136 \end{key}
137
138 \begin{key}{/pgfgo/stone/scale = \meta{float} (initially 1)}
139
140 Defines a scaling factor that affects all elements of the stone (radius, border, markings), maintaining their proportions.
141 \end{key}
142
143 \begin{key}{/pgfgo/stone/black}
144
145 Assigns the stone the characteristics of the first player (black by default), including fill and border color. This is the initial state of any stone unless another option is specified.
146
147 \begin{codeexample}[]
148 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
149
150 \begin{goban}
151 \stones[b]{C2,D3}
152 \stone[w]{B4}
153 \end{goban}
154
155 \begin{goban}
156 \stones[b]{C2,D3}
157 \stone[black]{B4}
158 \end{goban}
159 \end{codeexample}
160 \end{key}
161
162 \begin{key}{/pgfgo/stone/b}
163
164 Abbreviation for "black," with identical functionality.
165 \end{key}
166
167 \begin{key}{/pgfgo/stone/white}
168
169 Assigns the stone the characteristics of the second player (white by default), with a white fill and black border.
170
171 \begin{codeexample}[]
172 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
173
174 \begin{goban}
175 \stones[b]{C2,D3}
176 \stone[white]{B4}
177 \end{goban}
178
179 \begin{goban}
180 \stones[white]{C2,D3}
181 \stone[white]{B4}
182 \end{goban}
183 \end{codeexample}
184 \end{key}
185
186 \begin{key}{/pgfgo/stone/w}
187
188 Abbreviation for "white," with the same functionality.
189 \end{key}
190
191 \begin{key}{/pgfgo/stone/mark = \meta{mark keys}}
192
193 Places a mark on the stone (e.g., triangle, circle). Marks can be further customized with other keys, such as color or size.
194
195 \begin{codeexample}[]
196 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
197
198 \begin{goban}
199 \stones[b]{C2,D3}
200 \stone[w]{B4}
201 \end{goban}
202
203 \begin{goban}
204 \stones[b, mark = triangle]{C2,D3}
205 \stone[w, mark = t-circle]{B4}
206 \end{goban}
207 \end{codeexample}
208 \end{key}
209
210 \begin{key}{/pgfgo/stone/forget}
211
212 When the board uses a memory system (|new remember|, |resume|), this option indicates that the stone should not be remembered, allowing it to be excluded from subsequent states.
213
214 \begin{codeexample}[]
215 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
216
217 \begin{goban}[new remember]
218 \stones[b]{C2,D3}
219 \stone[w, forget]{B4}
220 \end{goban}
221
222 \begin{goban}[resume]
223 \end{goban}
224 \end{codeexample}
225 \end{key}
226
227 \begin{key}{/pgfgo/stone/remember}
228
229 In a board with active memory, ensures that the stone is remembered even if the general environment uses |forget|.
230
231 \begin{codeexample}[]
232 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
233
234 \begin{goban}[forget]
235 \stones[b]{C2,D3}
236 \stone[w, remember]{B4}
237 \end{goban}
238
239 \begin{goban}[resume]
240 \end{goban}
241 \end{codeexample}
242 \end{key}
243
244 \begin{key}{/pgfgo/stone/prisoner=\meta{prisoner options} (default fill opacity = 0.5)}
245
246 Characterizes a stone as a prisoner, typically with reduced opacity (0.5 by default) to indicate it has been captured. Other options can be added to customize its appearance.
247
248 \begin{codeexample}[]
249 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
250
251 \begin{goban}
252 \stones[b]{C2,D3}
253 \stone[w]{B4}
254 \end{goban}
255
256 \begin{goban}
257 \stones[b, prisoner]{C2,D3}
258 \stone[white]{B4}
259 \end{goban}
260 \end{codeexample}
261 \end{key}
262
263 \subsection{Moves}
264
265 Move commands allow representing sequences of plays, automatically alternating between black and white. They include options for numbering the moves and customizing the associated stones.
266
267 \begin{command}{\move\opt{*}\opt{\oarg{options}}\marg{intersection}}
268
269 Draws a stone as part of a move sequence, automatically alternating colors (black, white, black, etc.). The starred version (|\move*|) adds a numeric label to the stone.
270 \end{command}
271
272 \begin{command}{\moves\opt{*}\opt{\oarg{options}}\marg{intersection \opt{, intersection, ...}}}
273
274 Similar to |\move|, but applies the sequence to multiple intersections in a single line.
275 \end{command}
276
277 It is possible to change options for all players using |\pgfgoset{move = {...}}|, which is equivalent to |\pgfgoset{players = {all = {move = {...}}}}|.
278
279 \begin{key}{/pgfgo/move/black}
280
281 Sets the move sequence to start with the black player, useful for forcing the start of a play in specific diagrams.
282
283 \begin{codeexample}[]
284 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
285
286 \begin{goban}
287 \stones[b]{C2,D3}
288 \stone[w]{B4}
289 \end{goban}
290
291 \begin{goban}
292 \moves[b]{C2,B4}
293 \move{D3}
294 \end{goban}
295 \end{codeexample}
296 \end{key}
297
298 \begin{key}{/pgfgo/move/white}
299
300 Sets the sequence to start with the white player, altering the natural order of moves.
301
302 \begin{codeexample}[]
303 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
304
305 \begin{goban}
306 \stones[b]{C2,D3}
307 \stone[w]{B4}
308 \end{goban}
309
310 \begin{goban}
311 \moves[white]{C2,B4}
312 \move{D3}
313 \end{goban}
314 \end{codeexample}
315 \end{key}
316
317 \begin{key}{/pgfgo/move/from = \meta{number}}
318
319 Defines the starting number of a numbered move sequence, allowing continuation from a specific point instead of starting at 1.
320
321 \begin{codeexample}[]
322 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
323
324 \begin{goban}
325 \stones[b]{C2,D3}
326 \stone[w]{B4}
327 \end{goban}
328
329 \begin{goban}
330 \moves*[from = 7]{C2,B4}
331 \move*{D3}
332 \end{goban}
333 \end{codeexample}
334 \end{key}
335
336 \begin{key}{/pgfgo/move/label = \meta{options}}
337
338 Controls the properties of numeric labels in starred moves, such as size, color, or format.
339 \end{key}
340
341 %\begin{key}{/pgfgo/move/label/font size=\meta{dimension} (initially 0.5em)}
342 %
343 % Adjusts the font size of the labels, allowing them to adapt to the stone size or overall design.
344 %
345 % \begin{codeexample}[]
346 % \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
347 %
348 % \begin{goban}
349 % \stones[b]{C2,D3}
350 % \stone[w]{B4}
351 % \end{goban}
352 %
353 % \begin{goban}
354 % \moves*[from = 7]{C2,B4}
355 % \move*[label = {font size = 0.125em}]{D3}
356 % \end{goban}
357 % \end{codeexample}
358 %\end{key}
359
360 \begin{key}{/pgfgo/move/label/format = \meta{options} (initially arabic)}
361
362 Defines the numbering style of the labels.
363 \end{key}
364
365 \begin{key}{/pgfgo/move/label/format/arabic}
366
367 Uses Arabic numerals, the default format for move labels.
368
369 \begin{codeexample}[]
370 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
371
372 \begin{goban}
373 \stones[b]{C2,D3}
374 \stone[w]{B4}
375 \end{goban}
376
377 \begin{goban}
378 \moves*[from = 7]{C2,B4}
379 \move*{D3}
380 \end{goban}
381 \end{codeexample}
382 \end{key}
383
384 \begin{key}{/pgfgo/move/label/format/alph}
385
386 Uses lowercase letters for the labels.
387
388 \begin{codeexample}[]
389 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
390
391 \begin{goban}
392 \stones[b]{C2,D3}
393 \stone[w]{B4}
394 \end{goban}
395
396 \pgfgoset{move={label = {format=alph}}}
397 \begin{goban}
398 \moves*[from = 7]{C2,B4}
399 \move*{D3}
400 \end{goban}
401 \end{codeexample}
402 \end{key}
403
404 \begin{key}{/pgfgo/move/label/format/Alph}
405
406 Uses uppercase letters.
407
408 \begin{codeexample}[]
409 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
410
411 \begin{goban}
412 \stones[b]{C2,D3}
413 \stone[w]{B4}
414 \end{goban}
415
416 \pgfgoset{move = {label = {format = Alph}}}
417 \begin{goban}
418 \moves*[from = 7]{C2,B4}
419 \move*{D3}
420 \end{goban}
421 \end{codeexample}
422 \end{key}
423
424 \begin{key}{/pgfgo/move/label/format/roman}
425
426 Uses lowercase Roman numerals.
427
428 \begin{codeexample}[]
429 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
430
431 \begin{goban}
432 \stones[b]{C2,D3}
433 \stone[w]{B4}
434 \end{goban}
435
436 \pgfgoset{move = {label = {format = roman}}}
437 \begin{goban}
438 \moves*{C2,B4}
439 \move*{D3}
440 \end{goban}
441 \end{codeexample}
442 \end{key}
443
444 \begin{key}{/pgfgo/move/label/format/Roman}
445
446 Uses uppercase Roman numerals.
447
448 \begin{codeexample}[]
449 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
450
451 \begin{goban}
452 \stones[b]{C2,D3}
453 \stone[w]{B4}
454 \end{goban}
455
456 \pgfgoset{move = {label = {format = Roman}}}
457 \begin{goban}
458 \moves*{C2,B4}
459 \move*{D3}
460 \end{goban}
461 \end{codeexample}
462 \end{key}
463
464 \begin{key}{/pgfgo/move/label/color = \meta{color}}
465
466 Defines the color of the labels.
467
468 \begin{codeexample}[]
469 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
470
471 \begin{goban}
472 \moves*{C2,B4}
473 \move*{D3}
474 \end{goban}
475
476 \begin{goban}
477 \moves*[label = {color = red}]{C2,B4}
478 \move*[label = {color = blue}]{D3}
479 \end{goban}
480 \end{codeexample}
481 \end{key}
482
483 \begin{key}{/pgfgo/move/label/forget}
484
485 Prevents move labels from being stored in the board’s memory when using |remember|, allowing stones to persist without their numbers.
486
487 \begin{codeexample}[]
488 \pgfgoset{goban = {5, partial = {from = B2 to D4}}}
489
490 \begin{goban}[new remember]
491 \moves*[label = forget]{C2,B4,D3}
492 \end{goban}
493
494 \begin{goban}[resume]
495 \moves*{C:D4}
496 \end{goban}
497 \end{codeexample}
498 \end{key}
499
500 \begin{key}{/pgfgo/move/label/remember}
501
502 Ensures that labels are stored in memory, even if the environment uses |forget|, maintaining their continuity in subsequent diagrams.
503 \end{key}
504
505 \begin{key}{/pgfgo/move/forget}
506
507 Indicates that moves should not be remembered in the board’s memory, removing them from future states when using |resume|.
508 \end{key}
509
510 \begin{key}{/pgfgo/move/remember}
511
512 Ensures that moves are remembered, preserving them for reuse with |resume|.
513 \end{key}
514
515 \subsection{Prisoners}
516
517 \pgfgoname\ provides specific commands to represent prisoners, typically with reduced opacity to distinguish them from active stones.
518
519 \begin{command}{\prisoner\opt{\oarg{options}}\marg{intersection}}
520
521 Draws a prisoner stone at a specific intersection, with options to customize its style.
522 \end{command}
523
524 \begin{command}{\prisoners\opt{\oarg{options}}\marg{intersection \opt{, intersection, ...}}}
525
526 Places multiple prisoner stones in a single line, efficient for showing captured groups.
527 \end{command}
528
529 \begin{key}{/pgfgo/prisoner=\meta{stone options} (default fill opacity = 0.5)}
530
531 Defines the characteristics of prisoner stones, with a default fill opacity of 0.5 to indicate their status. Other |\stone| options, such as color or size, can be applied.
532
533 \end{key}