2' '75ư>HELPA\NhNN:lCONTINUEhh(pxEXIT&%p=lHALTމPldSTEP 1~4߉lg STOP߉X^F%EFSTOP ,,OFFg^w@߉U SHOW X$AnswerT߉W Oаgp߉.Odа@g|߉а@|ŻOdgа@ModelsFactorl1.gpsLFeCFEO JhL JhRMhE(((((((((({\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern Courier New;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\tx1200\tx2400\tx4450\plain\f2\fs20 ; GPSS World Sample File - FACTORL1.GPS \par ; \par ; This model uses a recursive PLUS Procedure to \par ; calculate factorials. \par ; You can either change the INITIAL statement to \par ; calculate factorials based on different values, \par ; or use the INITIAL command after the Model is \par ; Translated to Initialize the SAVEVALUE Facval. \par ; After the model has run, you can press the \par ; function key to display the value of the \par ; calculation in the status line. This function \par ; key has been preset to display X$Answer. \par ; This PLUS Procedure is designed to calculate \par ; Factorials for positive integers only. \par ; \par \tab INITIAL \tab X$Facval,10 \par \tab GENERATE\tab 1 \par \tab SAVEVALUE\tab Answer,(Factorial(X$Facval)) \par \tab TERMINATE\tab 1 \par \par \par PROCEDURE Factorial(Arg1) BEGIN \par \par IF (Arg1<=1) THEN RETURN 1; \par ELSE RETURN (Arg1#(Factorial(Arg1-1))); \par \par END; \par \par \par }