%BEGIN
%owninteger fail=0
%INTEGER I
%INTEGERFN FACT(%INTEGER N)
      %IF N<=1 %THENRESULT=1
      %RESULT=N*FACT(N-1)
%END
%ROUTINE COMPARE(%INTEGER I,J)
      %UNLESS I=J %START
         PRINTSTRING("ERROR")
         WRITE(I,5); WRITE(J,5)
         Fail=1; NEWLINE
      %FINISH
%END
      COMPARE(FACT(I),I*FACT(I-1)) %FOR I=2,1,10
      %if fail=0 %then printstring("TEST OK")
%ENDOFPROGRAM
