Fabrizio
There's probably a way to do this directly within tikz; and I'm sure
there's a more elegant way to do this, but the following does what you
want. -Alan
\documentclass{article}
\usepackage{tikz,ifthen,calc}
\newcounter{mysum}
\begin{document}
\begin{tikzpicture}
\foreach \x in {1,...,6}
\foreach \y in {1,...,6}
{
\setcounter{mysum}{\x+\y};
\draw (\x,\y) +(-.5,-.5) rectangle ++(.5,.5);
\ifthenelse{\value{mysum}>6}{\def\mycol{red}}{\def\mycol{blue}}
\draw[color=\mycol](\x,\y) node{\x,\y};
}
\end{tikzpicture}
\end{document}