Package Fact
\
  Affichage d'entiers
                      \
Sub PutCar(I As Int)
Enter
  Ax=&h0e00+I
  Inline(&hcd,&h10)
Leave

Sub PrintX(I As Int)
Var
   J,D As Int
Enter
  J=&H1000
  While J<>0 Do
    D=I/J
    I=I-(I/J)*J
    J=J/&H10
    If D<0 Then D=0-D;
    If D<10 Then PutCar(D+48)
            Else PutCar(D+55);
  Wend
Leave

\
  La factorielle recursive
                           \
Def Fact(N As Int) As Int
Enter
  If N=0 Then Result=1
  Else
    Result=N*Fact(N-1);
Leave

Enter
  PrintX(Fact(6))
Leave