#include <stdio.h>
#include <string.h>
#include <time.h>
+#include <malloc.h>
+#include <stdlib.h>
/* Section For Dummies part 1, updated 2004-05-07 by xCh. */
#define not !
+#define and &&
+#define or ||
#define TRUE 1
#define FALSE 0
#define loop while(1)
-#define iterate(VAR,FROM,TO) for(VAR=FROM; VAR <= TO; VAR++)
-#define repeat(N) iterate(_i,1,N)
+//#define iterate(VAR,FROM,TO) for(VAR=FROM; VAR <= TO; VAR++)
+//#define repeat(N) iterate(_i,1,N)
+#define repeat(N) _NEW_I for range(_I,1,N)
/* Dynamic list macros & sequences, updated 2003-05-29 by xCh. */
#define list(T) struct T *_next
#define create(A,T) (A=(struct T *)malloc(sizeof(struct T)),A->_next=NULL)
-#define push(A,B) { if(A && A!=B) A->_next=B; B=A; }
-#define append(A,B) { if(B) { void *N=A; A->_next=NULL; search(A,B,!A->_next) {A->_next=N; break;}} else push(A,B); }
-#define remove(A,B,C) { void **_D=NULL; search(A,B,C) { if(_D)*_D=A->_next; else B=A->_next; free(A); } else _D=(void *)&(A->_next); }
-#define drop(A,B) { for( A=B; A ; B=A, A=A->_next, free(B)); B=NULL; }
+#define push(A,B) ((A && A!=B)?A->_next=B:0,B=A)
+#define pop(A,B) (B?((A?free(A):0),A=B=B->_next):(A=NULL))
+#define append(A,B) if(B) { void *N=A; A->_next=NULL; search(A,B,!A->_next) {A->_next=N; break;}} else push(A,B);
+#define remove(A,B,C) { void **_D=NULL; search(A,B,C) { if(_D)*_D=A->_next; else B=A->_next; free(A); A=NULL;} else _D=(void *)&(A->_next); }
+#define drop(A,B) for( A=B; A || (B=NULL); B=A, A=A->_next, free(B) )
/* Dynamic list iterations and sequences, updated 2003-05-29 by xCh. */
#define search(A,B,C) every(A,B) if(C)
#define find(A,B,C) search(A,B,C) break; if(A)
+/* Enlightened iterations usable in for() , updated 2007-12-11 by xCh. */
+
+#define range(VAR,FROM,TO) (VAR=FROM; VAR <= TO; VAR++)
+#define each ((A,B) A=B; A; A=A->_next)
+#define lines(STR,F) ()
+
/* EXP macros for Dummysort sequences, updated 2003-05-29 by xCh. */
#define order_by(K1,K2) (K1>K2)
/* Section For Dummies part 2, updated 2004-05-07 by xCh. */
#define program int _I; int main(int argc, char **argv)
+#define _ISTACK struct _IStack { int I; int _23; list(_IStack); } *_Iatom,*_Istack=NULL;
+#define _SSTACK struct _SStack { char *S; int _23; list(_SSTACK); } *_Satom,*_Sstack=NULL;
+#define _FSTACK struct _FStack { FILE *F; int _23; list(_FSTACK); } *_Fatom,*_Fstack=NULL;
+#define program2 _ISTACK _SSTACK _FSTACK int main(int argc, char **argv)
+#define _NEW_I for(create(_Iatom,_IStack),_Iatom->_23=1,push(_Iatom,_Istack);_Iatom->_23||pop(_Iatom,_Istack)&&0;_Iatom->_23--)
+#define _NEW_S for(create(_Satom,_SStack),_Satom->_23=1,push(_Satom,_Sstack);_Satom->_23||pop(_Satom,_Sstack)&&0;_Satom->_23--)
+#define _I _Iatom->I
+#define _S _Satom->I
#define arguments if(argc>1) for(_I=1;_I<argc;_I++)
#define argument(A) if(eq(argv[_I],A))
#define thisargument(S) (S=argv[_I])