🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #39

memory and loops - HELP

#39
From: Julio Kuplinsky
Date: Wed, 28 Oct 1992 03:46
76 lines
2368 bytes
I am trying to use picTeX to draw a diagram like this

   .   	   .	   .	  .	 .	 .	 .	.	.
-20 10		-10 10		0 10		10 10         20 10 
   .   	   .	   .	  .	 .	 .	 .	.	.
-20 0		-10 0		0 0		10 0          20 0     

except that the actual diagram has some 100 points instead of 18 as in the
picture. (I know, I don't need picTeX for this, but I need it for
another purpose). 

The thing I find puzzling is this: 

++ If I issue the individual PiCTeX commands everything works fine
   (even for diagrams 4 times as large).

++ If I write two nested loops (as below), even bigTeX !!! (E. Mattes)
   chokes and complains about capacity exceeded. So the problem seems
   to lie with the loops, and not with picTeX being large, but who knows?

What is so taxing about a mere 100 points (right, points, ie \fiverm. ) and
200 numbers??

Julio Kuplinsky

=============================================================================

\input pictex
\newcount\xlimit\xlimit=30 
\newcount\ylimit\ylimit=30 
\newcount\x
\newcount\y
\newcount\gridstep\gridstep=5
\newcount\xlabelstep\xlabelstep=10
\newif\ifcontinue\continuetrue

\beginpicture
\setcoordinatesystem units < 1mm , 1mm >
\fiverm

\y=-\ylimit
\x=-\xlimit
\loop
  \loop
    \put{.} at {\x} {\y}
    \advance\x by \gridstep
    \ifnum\x > \xlimit \continuefalse\fi
    \ifcontinue %% NOTE: I have to use this stupid construct because
  \repeat       %% TeX won't allow \ifnum\x <= \xlimit. Am I mssng smthng?
\x=-\xlimit
\continuetrue
\advance\y by \gridstep
\ifnum\y > \ylimit \continuefalse\fi
\ifcontinue
\repeat

\continuetrue
\x=-\xlimit
\y=-\ylimit
\loop
  \loop
    \put{{\the\x} {\the\y}} <0mm,-1mm> at {\x} {\y}
    \advance\x by \xlabelstep
    \ifnum\x > \xlimit \continuefalse\fi
    \ifcontinue
  \repeat
  \x=-\xlimit
  \continuetrue
  \advance\y by \gridstep
  \ifnum\y > \ylimit\continuefalse\fi
  \ifcontinue
\repeat

\endpicture
\bye
Technical Details
Message-ID: <Oct.27.22.46.52.1992.2962@math.rutgers.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!uwm.edu!rutgers!igor.rutgers.edu!math.rutgers.edu!kuplinsk

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!uwm.edu!rutgers!igor.rutgers.edu!math.rutgers.edu!kuplinsk
From: kuplinsk@math.rutgers.edu (Julio Kuplinsky)
Newsgroups: comp.text.tex
Subject: memory and loops - HELP
Message-ID: <Oct.27.22.46.52.1992.2962@math.rutgers.edu>
Date: 28 Oct 92 03:46:52 GMT
Article-I.D.: math.Oct.27.22.46.52.1992.2962
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 76