I need a nested loop to animate PSTricks diagrams. In C# or C or C++, I usually write as follows.
int N=6;
for(int x=0; x<N; x++)
for(int y=x+1; y<N; y++)
Console.WriteLine("({0}, {1})",x,y);
I have attempted to do it in TeX as follows, but it does not work. :-)
\documentclass{minimal}
\usepackage{multido}
\newcommand\N{6}
\newcommand\Init{}
\newcommand\Freq{}
\begin{document}
\multido{\ix=0+1}{\N}
{
\makeatletter
\renewcommand\Init{\strip@pt\dimexpr\ix pt + 1pt\relax}
\renewcommand\Freq{\strip@pt\dimexpr\N pt - \Init pt\relax}
\makeatother
\multido{\iy=\Init+1}{\Freq}
{
(\ix, \iy)\par
}
}
\end{document}
How to fix it?