Chinese checkers board

We use a \foreach loop that takes the number of positions in each row as the loop list. For the standard chinese checkers boards, that could look like \foreach \m [count=\count] in {1,…,4,13,12,…,9,10,11,…,13,4,3,…,1}.

If you systematically name the nodes you create in this loop, you’ve got a very nice framework for drawing Chinese Checkers setups and moves. I’ve written a couple of macros and styles for this.

The command \checkerboard[checkerboard labels] will draw a blank board with the fields labeled .

We can then place pieces using

\placepieces[]{}

and show moves using

\showmove{}

Chinese checkers board

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{backgrounds,decorations}
\begin{document}
\begin{tikzpicture}
\newif\ifcheckerboardlabels
\tikzset{
pieces/.style={
fill,
circle,
minimum size=0.5cm
},
positions/.style={
fill=black!5, draw=gray,
solid,
circle,
minimum size=0.6cm,
inner sep=0pt,
},
checkerboard labels/.is if=checkerboardlabels,
checkerboard labels/.default=true,
move/.style={
-latex,
densely dashed,
very thick,
bend right=45
}
}
\newcommand{\checkerboard}[1][]{
\begin{scope}[#1]
\foreach \m [count=\count] in {1,...,4,13,12,...,9,10,11,...,13,4,3,...,1}{
\foreach \n in {1,...,\m}
\node at (\n-\m/2,\count) [
positions,
name=pos-\count-\n,
outer sep=0.5cm,
label=center:{\ifcheckerboardlabels \count-\n\fi}] {};
}
\begin{pgfonlayer}{background}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Leave a Reply

Your email address will not be published.