I am trying to produce a 6-by-6 checkboard of small circles, alternating colour between red and black.
To do this I have attempted to use \pgfmathparse and \ifnum in order to decide if to colour a circle red or back:
\documentclass[11pt]{article}
\pagestyle{empty}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\foreach \x in {0,...,5} \foreach \y in {0,...,5}
{
\pgfmathparse{mod(\x+\y,2)}
\ifnum\pgfmathresult=0{\path[fill=black] (\x*0.5cm,\y*0.5cm) circle (0.1cm);}
\else{\path[fill=red] (\x*0.5cm,\y*0.5cm) circle (0.1cm);}\fi
}
\end{tikzpicture}
\end{document}
Although the code errors when I attempted to run it through pdflatex with ! Missing = inserted for \ifnum. and ! Missing number, treated as zero. it does produce the expected result.
What precisely am I doing wrong with regards to the calculation and how should one go about producing such a picture?

