Artifact ef20174d2755ccbfb8f54aa9b9214b8de5e4865605072dfdea33c7d6d166754b:
- File
psl-1983/tests/main1.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 918) [annotate] [blame] [check-ins using] [more...]
% Simple 1 file test % This is program MAIN1.RED On SYSLISP; IN "XXX-HEADER.RED"$ Procedure FirstCall; <<Init(); PutC Char A; PutC Char B; Terpri(); PutInt Ifact 10; Terpri(); TestFact(); Terpri(); TestTak(); Quit;>>; procedure terpri(); PutC Char EOL; Procedure TestFact(); << Timc(); Terpri(); ArithmeticTest 10000; Timc();>>; Procedure ArithmeticTest (N); begin scalar I; I:= 0; loop: if Igreaterp(I,N) then return NIL; Fact 9; I := iadd1 I; goto loop end; procedure TestTak(); <<Timc(); PutInt TopLevelTak (18,12,6); Terpri(); Timc();>>; in "pt:tak.sl"; syslsp procedure Fact (N); If ilessp(N,2) then 1 else LongTimes(N,Fact isub1 N); syslsp procedure Ifact u; Begin scalar m; m:=1; L1: if u eq 1 then return M; M:=LongTimes(U,M); u:=u-1; PutInt(u); Terpri(); PutInt(M); Terpri(); goto L1; end; end;