\section{Stones, moves and prisoners}
\label{sec:piedras}

Stones are drawn with |\stone| and |\stones|; moves, with |\moves|, and prisoners, with |\prisoner| and |\prisoners|.

\subsection{Stones}

\begin{command}{\stone\opt{\oarg{options}}\marg{intersection}}
	Draws a stone on the intersection (for example, |C2|). The options change its style: the color, the size, a mark, etc. If the player is not given (|b|, |w| or |n|), the stone is \emph{neutral}.
\end{command}


\begin{command}{\stones\opt{\oarg{options}}\marg{intersection \opt{, intersection, ...}}}
	Like |\stone|, but with several intersections, written with the coordinate syntax (p.~\pageref{subsec:sintaxis-de-coordenadas}). If the player is not given, the stones are \emph{neutral} too: for black stones, write |\stones[b]{...}|.
\end{command}

Stones, marks and labels that fall outside the visible region of a partial board are not drawn. A coordinate that does not exist on the board (for example, |E9| on a 5$\times$5 board) is ignored and gives a warning.

An option can be changed for every player with |\pgfgoset{stone = {...}}|. This is equivalent to |\pgfgoset{players = {all = {stone = {...}}}}|.


\begin{key}{/pgfgo/stone/fill = \meta{options} (default true)}
	Options of the fill of the stone.
\end{key}

\begin{key}{/pgfgo/stone/fill/true}
	Draws the fill.
\end{key}

\begin{key}{/pgfgo/stone/fill/false}
	Does not draw the fill.

	\begin{codeexample}[]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		% What is seen in the figure is what is left of the stone: shadows and shines.
		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w, fill = false]{B4}
		\end{goban}
	\end{codeexample}
\end{key}


\begin{key}{/pgfgo/stone/fill/color = \meta{color}}
	Color of the fill.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[fill = {color = cyan!80!black}]{C2,D3}
			\stone[fill = {color = magenta!80!black}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/fill/opacity = \meta{float} (initially 1)}

	Opacity of the fill.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b, fill = {opacity = 0.8}]{C2,D3}
			\stone[w, fill = {opacity = 0.5}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}


\begin{key}{/pgfgo/stone/line = \meta{option} (default true, initially true)}
	Options of the border of the stone.
\end{key}

\begin{key}{/pgfgo/stone/line/true}
	Draws the border.

	\begin{codeexample}[]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w, line = true]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/line/false}
	Does not draw the border.
\end{key}

\begin{key}{/pgfgo/stone/line/color = \meta{color} (initially black)}

	Color of the border.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b, line = {color = magenta}]{C2,D3}
			\stone[w, line = {color = cyan}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/line/opacity = \meta{float} (initially 1)}

	Opacity of the border.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b, line = {opacity = 0.5}]{C2,D3}
			\stone[w, line = {opacity = 0.8}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/line/width = \meta{dimension} (initially 0.7pt)}

	Width of the border.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w, line = {width = 2pt}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/radius = \meta{dimension} (initially 5.5pt)}

	Radius of the stone.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b, radius = 0.15cm]{C2,D3}
			\stone[w, radius = 0.25cm]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/scale = \meta{float} (initially 1)}

	Scales the whole stone: the radius, the border and the marks.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[b, mark = circle]{C2}
			\stones[b, scale = 0.7, mark = circle]{D3}
			\stone[w, scale = 1.3, mark = triangle]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/black}

	The stone belongs to the first player, with its style. Without |black| (or |b|), |\stone| and |\stones| draw neutral stones.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[black]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/b}

	Short for |black|.
\end{key}

\begin{key}{/pgfgo/stone/white}

	The stone belongs to the second player, with its style.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[white]{B4}
		\end{goban}

		\begin{goban}
			\stones[white]{C2,D3}
			\stone[white]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/w}

	Short for |white|.
\end{key}

\begin{key}{/pgfgo/stone/neutral}
	The stone belongs to the neutral player. It is the default player of |\stone| and |\stones|.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[b]{C2}
			\stones[w]{D3}
			\stone{B4}
			\stone[n]{C3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/n}
	Short for ``neutral''.
\end{key}

\begin{key}{/pgfgo/stone/shadow = \meta{options} (default true)}
	Shadow of the stone, drawn underneath. By default it has the silhouette of the stone: the circle, or the shape of the image if the stone is an image (|image|). With |shadow/image|, the shadow is an image of its own. In both cases it is moved |offset| towards |angle| and enlarged |scale| times.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b, shadow = {true, angle = -45, offset = 1.5pt}]{C2,D3}
			\stone[w, shadow = {true, angle = -45, offset = 1.5pt}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/true}
	Draws the shadow.
\end{key}

\begin{key}{/pgfgo/stone/shadow/false}
	Does not draw the shadow.
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {white = {stone = {shadow = false}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/angle = \meta{float} (initially 0)}
	Where the shadow falls, in degrees: with |0|, to the right; with |-45|, down to the right. It does not turn the shape of the shadow.
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {white = {stone = {shadow = {angle = 225}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/offset = \meta{dimension} (initially 1pt)}
	How far the shadow is moved from the center of the stone, in the direction |angle|.
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {white = {stone = {shadow = {offset = 0.125cm}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/opacity = \meta{float} (initially 0.5)}
	Opacity of the shadow (also that of the shadow with an image).
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {white = {stone = {
			shadow = {offset = 0.125cm, opacity = 0.1}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/color = \meta{color} (initially black)}
	The color of the shadow. A shadow with an image has its own colors, except with |image/silhouette|.

	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}
		\pgfgoset{players = {white = {stone = {
			shadow = {color = blue, offset = 0.1cm}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/scale = \meta{float} (initially 1)}
	Enlarges (or reduces) the shadow with respect to the stone. A shadow larger than the stone makes it look taller. It also enlarges the shadow with an image.

	\begin{codeexample}[width=4cm]
		\pgfgoset{goban = {partial = A1:C3, scale = 2}}

		\begin{goban}
			\stone[b, shadow = {true, angle = -45}]{A1}
			\stone[b, shadow = {true, angle = -45,
				scale = 1.3}]{C2}
			\stone[w, shadow = {true, offset = 0pt,
				scale = 1.3, color = red}]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/image = \meta{options}}
	A shadow of your own: an image with transparency (PNG or PDF), centered on the stone and drawn as it is instead of the silhouette, for example a soft shadow. It is moved and enlarged like the silhouette (|angle|, |offset|, |scale|) and uses |opacity|, but not |color|. It does not turn with the image of the stone (|stone/image/rotate|), so it always falls to the same side. Each file is kept only once in the PDF.

	\begin{codeexample}[width=4cm]
		\pgfgoset{goban = {partial = A1:C3, scale = 2}}
		\pgfgoset{stone = {shadow = {true, angle = -45,
			offset = 1.5pt, opacity = 0.8,
			image = {file = pgfgo-shadow.png, width = 13pt}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shadow/image/file = \meta{file}}
	The file of the image. It is looked for as with |\includegraphics|.
\end{key}

\begin{key}{/pgfgo/stone/shadow/image/width = \meta{dimension} (initially the diameter of the stone)}
	The width of the image; the height keeps the proportion.
\end{key}

\begin{key}{/pgfgo/stone/shadow/image/rotate = \meta{angle} (initially 0)}
	Turns the image of the shadow, the same on every stone.
\end{key}

\begin{key}{/pgfgo/stone/shadow/image/silhouette = \meta{boolean} (default true, initially false)}
	Uses only the shape of the image (its transparency), painted with |shadow/color|, instead of the image as it is. It needs pdf\LaTeX\ or Lua\LaTeX\ with PDF output; with other engines the shadow is not drawn and a warning appears.

	\begin{codeexample}[width=4cm]
		\pgfgoset{goban = {partial = A1:C3, scale = 2}}
		\pgfgoset{stone = {shadow = {true, angle = -45,
			offset = 2pt, color = blue,
			image = {file = pgfgo-star.pdf, width = 16pt,
				rotate = 18, silhouette}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{stylekey}{/pgfgo/stone/shadow/image/false}
	Removes the image: the silhouette of the stone comes back.
\end{stylekey}

\begin{key}{/pgfgo/stone/shine = \meta{options} (default true)}
	Shine of the stone, drawn on top of it, be it a circle or an image.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b, shine]{C2,D3}
			\stone[w, shine = {true, color = gray}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/true}
	Draws the shine.
\end{key}

\begin{key}{/pgfgo/stone/shine/false}
	Does not draw the shine.
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {black = {stone = {shine = false}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/angle = \meta{float} (initially 0)}
	Turns the drawn shine. With |0|, the light comes from the top left.
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {black = {stone = {shine = {angle = 45}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/opacity = \meta{float} (initially 1)}
	Opacity of the shine (also that of the shine with an image).
	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}

		\pgfgoset{players = {black = {stone = {shine = {opacity = 0.5}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/color = \meta{color} (initially gray!50!white)}
	Color of the drawn shine.

	\begin{codeexample}[width=4cm]
		\pgfgoset{profile = pgfgosmooth}
		\pgfgoset{goban = {partial = A1:C3}}
		\pgfgoset{players = {black = {stone = {shine = {color = red}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/image = \meta{options}}
	A shine of your own: an image with transparency (PNG or PDF), centered on the stone, instead of the drawn shine. If the stone is an image too, the shine is drawn on top and does not turn with it (|stone/image/rotate|): the stones can have stripes turned at random and the light always on the same side. Each file is kept only once in the PDF.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[w, image = {file = pgfgo-yunzi-white-1.png, rotate = random},
				shine = {true, image = {file = pgfgo-shine.png}}]{B2, C2, D2, B3, C3, D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/image/file = \meta{file}}
	The file of the image. It is looked for as with |\includegraphics|.
\end{key}

\begin{key}{/pgfgo/stone/shine/image/width = \meta{dimension} (initially the diameter of the stone)}
	The width of the image; the height keeps the proportion.
\end{key}

\begin{key}{/pgfgo/stone/shine/image/rotate = \meta{angle} (initially 0)}
	Turns the image of the shine, the same on every stone.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[w, image = {file = pgfgo-yunzi-white-1.png},
				shine = {true, image = {file = pgfgo-shine.png, width = 0.3cm,
					rotate = 90}}]{B2:D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/shine/image/silhouette = \meta{boolean} (default true, initially false)}
	Uses only the shape of the image (its transparency), painted with |shine/color|, instead of the image as it is. It needs pdf\LaTeX\ or Lua\LaTeX\ with PDF output; with other engines the shine is not drawn and a warning appears.

	\begin{codeexample}[width=4cm]
		\pgfgoset{goban = {partial = A1:C3, scale = 2}}
		\pgfgoset{players = {black = {stone = {shine = {true,
			color = red, image = {file = pgfgo-shine.png, silhouette}}}}}}

		\begin{goban}
			\stones[b]{B1,C2}
			\stone[w]{A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{stylekey}{/pgfgo/stone/shine/image/false}
	Removes the image: the drawn shine comes back.
\end{stylekey}


\label{subsec:piedrasimagen}\begin{key}{/pgfgo/stone/image = \meta{options}}
	Draws the stone with an image (PNG, JPG or PDF) instead of the circle: neither the fill nor the border is drawn, and the image need not be round. If the shine (|shine|) is on, it is drawn on top of the image. The shadow (|shadow|) is drawn with the shape of the image; for that the image has to have transparency (a PNG with an alpha channel or a PDF): the shadow of a JPG is a rectangle. A prisoner with an image looks translucent, like any prisoner.

	The files are looked for as with |\includegraphics| (for example, in the folders of |\graphicspath|) and, if they are not there, among the images that come with \pgfgoname, next to |pgf-go.sty| (those of the profiles |shell|, |yunzi| and |baduktv|, p.~\pageref{subsec:perfilshell}). Each file, at each size, is kept only once in the PDF, however many stones use it (p.~\pageref{subsubsec:imagenespdf}). The shadow with the shape of the image needs pdf\LaTeX\ or Lua\LaTeX\ (with PDF output); with other engines the stone is drawn without a shadow and with a warning.

	A file name with a comma goes in double braces, |file = {{a,b.png}}|; with single braces, the comma separates two files. As with |\includegraphics|, the name cannot have |&|, |#|, |%|, |$|, |{| or |}|, nor two spaces in a row.

	SVG images cannot be used directly: they have to be converted to PDF first, for example with Inkscape or with rsvg-convert. The same holds for the background, the grid, the star points and the marks.

	\begin{codeexample}[code only]
		inkscape --export-type=pdf stone.svg
		rsvg-convert -f pdf -o stone.pdf stone.svg
	\end{codeexample}

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b, image = {file = pgfgo-yunzi-black.png},
				shadow = {true, angle = -45, offset = 1.5pt}]{C2,D3}
			\stone[w, image = {file = pgfgo-yunzi-white-1.png},
				shadow = {true, angle = -45, offset = 1.5pt}]{B4}
		\end{goban}
	\end{codeexample}

	For all the stones of a player, the image is given in its options:

	\begin{codeexample}[]
		\pgfgoset{players = {
			black = {stone = {image = {file = pgfgo-yunzi-black.png}}},
			white = {stone = {image = {file = pgfgo-yunzi-white-1.png}}}}}

		\begin{goban}[5, partial = B2:D4]
			\moves[numbers = false]{C3, D3, C2, B3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/image/file = \meta{file \opt{, file, ...}}}
	The file of the image. With several files, each stone uses one, chosen by its position: a stone on a point always shows the same image, in every diagram.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[w, image = {file = {pgfgo-yunzi-white-1.png, pgfgo-yunzi-white-2.png}}]{B2, C2, D2, B3, C3, D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/image/width = \meta{dimension} (initially the diameter of the stone)}
	The width of the image; the height keeps the proportion. By default it is the diameter of the stone: $2 \times$ |radius| $\times$ |scale|.
\end{key}

\begin{key}{/pgfgo/stone/image/rotate = \meta{angle}, |random| or \meta{minimum}|:|\meta{maximum} (initially 0)}
	Turns the image \meta{angle} degrees, counterclockwise. With |random|, each stone is turned by a different angle, chosen by its position: a stone on a point always looks the same, in every diagram and in every frame of an animation. The shadow turns with the image, but still falls to the same side.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[w, image = {file = pgfgo-yunzi-white-1.png,
				rotate = random}]{B2, C2, D2, B3, C3, D3}
		\end{goban}
	\end{codeexample}

	With a range \meta{minimum}|:|\meta{maximum}, the angle is chosen as with |random|, but between \meta{minimum} and \meta{maximum} degrees (|random| is the same as |0:360|).

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[w, image = {file = pgfgo-yunzi-white-1.png,
				rotate = -20:20}]{B2, C2, D2, B3, C3, D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/image/opacity = \meta{float} (initially 1)}
	The opacity of the image.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\stones[b, image = {file = pgfgo-yunzi-black.png}]{C2}
			\stones[b, image = {file = pgfgo-yunzi-black.png, width = 8pt}]{D3}
			\stone[w, image = {file = pgfgo-yunzi-white-1.png, opacity = 0.5}]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{stylekey}{/pgfgo/stone/image/false}
	Removes the image: the stone is a circle again.
\end{stylekey}

\begin{key}{/pgfgo/stone/mark = \meta{mark keys}}

	A mark on the stone, with the options of |\mark| (p.~\pageref{sec:marcas}). For example, |mark = triangle| or |mark = {circle, line = {color = red}}|.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b, mark = triangle]{C2,D3}
			\stone[w, mark = t-circle]{B4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/forget}

	|resume| does not bring this stone (p.~\pageref{subsec:recordar}). It stays in the memory of the named |goban|: |\pgfgoview| shows it with |forgotten|.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}[name = a]
			\stones[b]{C2,D3}
			\stone[w, forget]{B4}
		\end{goban}

		\begin{goban}[resume = a]
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/stone/prisoner=\meta{prisoner options} (default fill opacity = 0.5)}

	The stone is a prisoner: by default, with the fill at half opacity. The options added are applied after the style of the prisoners (|/pgfgo/prisoner| and that of the player).

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\stones[b, prisoner]{C2,D3}
			\stone[white]{B4}
		\end{goban}
	\end{codeexample}

	In the options of a player (|\pgfgoset{players = {white = {stone = {prisoner = ...}}}}|), it is the style of its prisoners: those of |\prisoner|, |\prisoners| and the \emph{key} |prisoner| of |\stone| and |\stones|, and the stones captured with |captures = fade|. It is applied after the fill opacity 0.5 and |/pgfgo/prisoner|, and before the options of the stone. The other stones of the player do not change.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}
		\pgfgoset{players = {white = {stone = {prisoner = {line = {color = red}}}}}}

		\begin{goban}
			\stones[w]{B3}
			\prisoner[b]{C3}
			\prisoner[w]{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\subsubsection{Images and the size of the PDF}
\label{subsubsec:imagenespdf}

With pdf\LaTeX\ or Lua\LaTeX\ (with PDF output), each image (of the stones, the background, the grid, the hoshi, the marks, the shine or the shadow) is kept in the PDF only once, the first time it is used; afterwards, in the whole document, each stone or tile that uses it only names it. A game drawn with |profile = shell| keeps the wood, the six stones and the shadow once, even if it has hundreds of stones spread over many diagrams. Turning an image (|rotate|) does not add another copy, and the shadow with the shape of the image (also with |silhouette|) uses the same copy. What does add a copy is another size: the same image with another |width|, or on boards with another |scale| (for example, with |fit|), is kept once for each size. With other engines (Xe\LaTeX, or DVI output), the image is included each time it is used, and the PDF grows with each stone.

Drawn stones, without an image, are not kept that way: each one is a circle and a few drawing instructions, almost the same as naming a kept copy. A more elaborate vector stone (gradients, drawn stripes) can be made in a PDF and used with |stone/image|: it looks sharp at any scale and is kept only once, like the other images.





\subsection{Moves}
\label{subsec:movimientos}

\begin{command}{\moves\opt{\oarg{options}}\marg{intersection \opt{, intersection, ...}}}

	Plays the intersections in the order in which they are written, alternating Black and White, and numbers them (|numbers|). An intersection can be repeated (for example, to take back a ko with |captures|). It accepts the syntax of |\stones| (p.~\pageref{subsec:sintaxis-de-coordenadas}) and plays each element in its order (p.~\pageref{subsec:orden-coordenadas}): a path (|A1 -- A3 -- C3|) goes from its first point to the last, and a segment, from the first end to the second (|C:A 4| goes from C4 to A4; |C5:1|, from C5 to C1). What has no fixed path (rectangles, |r|, whole columns and rows, |*|) is played all the same, with a warning. Subtractive groups (|;|) give an error: |\moves| only adds moves.

	\begin{codeexample}[]
		\begin{goban}[5]
			\moves{B1 -| D3, C:A 4, E5}
		\end{goban}
	\end{codeexample}
\end{command}

Inside one |goban|, the numbering and the turn go on from one |\moves| to the next. Each new |goban| starts at move 1 with Black; to continue a game in another diagram, use |from| and |b| or |w|, or |resume|.

The options of |\moves| also accept those of the style of the stone (|fill|, |line|, |radius|, |shine|, |image|, etc.) and |mark|, like |\stones|. For example, to mark the last move:

\begin{codeexample}[]
	\begin{goban}[5, partial = B2:D4]
		\moves[numbers = false]{C3, D3, C2}
		\moves[numbers = false, mark = circle]{B3}
	\end{goban}
\end{codeexample}

The options of every player can be changed with |\pgfgoset{move = {...}}|, which is equivalent to |\pgfgoset{players = {all = {move = {...}}}}|, except |numbers|, which does not belong to a player: it holds for every move.

\begin{key}{/pgfgo/move/numbers=\meta{boolean} (default true, initially true)}

	Whether the moves carry their number. Without numbers, the moves still count: the next move goes on with the numbering and the turn. As an option of |\moves| it holds for those moves; with |\pgfgoset{move = {numbers = false}}| or |\begin{goban}[move = {numbers = false}]|, for all the ones that follow.

	\begin{codeexample}[]
		\begin{goban}[5, partial = B2:D4]
			\moves[numbers = false]{C3, D3}
			\moves{C2, B3}
		\end{goban}

		\begin{goban}[5, partial = B2:D4, move = {numbers = false}]
			\moves{C3, D3}
			\moves[numbers]{C2, B3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/black}

	The sequence starts with Black.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\moves[numbers = false, b]{C2,B4}
			\moves[numbers = false]{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/white}

	The sequence starts with White.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\moves[numbers = false, white]{C2,B4}
			\moves[numbers = false]{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/b}
	Short for |black|.
\end{key}

\begin{key}{/pgfgo/move/w}
	Short for |white|.
\end{key}

\begin{key}{/pgfgo/move/from = \meta{number}}

	Number of the first move of the sequence.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\moves[from = 7]{C2,B4}
			\moves{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label = \meta{options}}

	Options of the numbers of the moves.

	\begin{codeexample}[width=4cm]
		\pgfgoset{players = {white = {move = {label = {
			color = red, font = \itshape, font size = 6pt, opacity = 0.6}}}}}

		\begin{goban}[3]
			\moves{A1, B2, C3, A3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/font = \meta{font commands} (initially \texttt{\string\bfseries})}
	Font of the numbers.
\end{key}

\begin{key}{/pgfgo/move/label/font size=\meta{dimension} (initially automatic)}

	Size of the numbers. If it is not given, it adjusts by itself according to the number of digits.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\moves[from = 7]{C2,B4}
			\moves[label = {font size = 0.5em}]{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/format = \meta{options} (initially arabic)}

	Format of the numbers: |arabic|, |alph|, |Alph|, |roman|, |Roman| or |kanji|.
\end{key}

\begin{key}{/pgfgo/move/label/format/arabic}

	Arabic numbers. It is the initial value.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\begin{goban}
			\moves[from = 7]{C2,B4}
			\moves{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/format/alph}

	Lowercase letters.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\pgfgoset{move={label = {format=alph}}}
		\begin{goban}
			\moves[from = 7]{C2,B4}
			\moves{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/format/Alph}

	Uppercase letters.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\pgfgoset{move = {label = {format = Alph}}}
		\begin{goban}
			\moves[from = 7]{C2,B4}
			\moves{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/format/roman}

	Lowercase Roman numbers.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\pgfgoset{move = {label = {format = roman}}}
		\begin{goban}
			\moves{C2,B4}
			\moves{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/format/Roman}

	Uppercase Roman numbers.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2,D3}
			\stone[w]{B4}
		\end{goban}

		\pgfgoset{move = {label = {format = Roman}}}
		\begin{goban}
			\moves{C2,B4}
			\moves{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/format/kanji}
	Numbers in kanji ({\pgfgokanji 一, 二, …, 十, 十一, …, 百}), like those of |goban/label/columns = kanji|. They need a font that has them, chosen with |label/font| (see |/pgfgo/mark/label/format|, p.~\pageref{key:kanji}).
\end{key}

\begin{key}{/pgfgo/move/label/color = \meta{color}}

	Color of the numbers.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\moves{C2,B4}
			\moves{D3}
		\end{goban}

		\begin{goban}
			\moves[label = {color = red}]{C2,B4}
			\moves[label = {color = blue}]{D3}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/label/opacity = \meta{float} (initially 1)}
	Opacity of the numbers.
\end{key}

\begin{key}{/pgfgo/move/label/forget}

	With |resume = {..., numbers}|, this move comes without its number (p.~\pageref{subsec:recordar}). With |\pgfgoview|, the number is only seen with |forgotten|.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}[name = a]
			\moves{C2}
			\moves[label = forget]{B4}
			\moves{D3}
		\end{goban}

		\begin{goban}[resume = {a, numbers}]
			\moves{C:D4}
		\end{goban}
	\end{codeexample}
\end{key}

\begin{key}{/pgfgo/move/forget}

	|resume| does not bring these moves, neither the stone nor the number. The numbering goes on from the last move it brings.
\end{key}


\subsection{Prisoners}

Prisoners are captured stones that remain on the board; by default they are drawn translucent.

\begin{command}{\prisoner\opt{\oarg{options}}\marg{intersection}}

	Draws a prisoner on the intersection. It accepts the options of |\stone|.
\end{command}

\begin{command}{\prisoners\opt{\oarg{options}}\marg{intersection \opt{, intersection, ...}}}

	Like |\prisoner|, with several intersections.
\end{command}

\begin{key}{/pgfgo/prisoner=\meta{stone options} (default fill opacity = 0.5)}

	Style of the prisoners: by default, the fill with opacity 0.5. It accepts the options of |\stone|. It holds for the prisoners of the three players; the style of each one (|stone/prisoner| in the options of the player) comes after.

	\begin{codeexample}[]
		\pgfgoset{goban = {5, partial = B2:D4}}

		\begin{goban}
			\stones[b]{C2}
			\prisoners[b]{D3}
			\prisoner[w]{B4}
		\end{goban}

		\pgfgoset{prisoner = {fill = {opacity = 0.2}, line = {color = red}}}

		\begin{goban}
			\stones[b]{C2}
			\prisoners[b]{D3}
			\prisoner[w]{B4}
		\end{goban}
	\end{codeexample}
\end{key}
