C This FORTRAN program may be compiled and run on a Norsk Data
C computer running SINTRAN and the FTN compiler. It uses only
C FORTRAN reserved words, and contains just one numerical
C constant, in a character string (a format specifier). When
C you run it, it prints a well known mathematical construct...
C
C Even FORTRAN is a block structured programming language:
C
PROGRAM
;PROGRAM;INTEGERIF,INTEGER,GOTO,IMPLICIT;REALREAL,DIMENSION,EXTERNA
AL,FORMAT,END;INTEGERLOGICAL;REALCOMPLEX,DATA,CALL,ASSIGN,CHARACTER
R;DOFORIF=INTEGER,INTEGER;ENDDO;INTEGER=IF+IF;GOTO=INTEGER*INTEGER*
*INTEGER*INTEGER-INTEGER-IF;CALLFUNCTION(IMPLICIT,REAL,DIMENSION,EX
XTERNAL,FORMAT,END,LOGICAL,COMPLEX,DATA,CALL,ASSIGN,CHARACTER);CALL
LSUBROUTINE(IMPLICIT,LOGICAL,GOTO,IF,INTEGER);END;SUBROUTINEFUNCTIO
ON(IMPLICIT,REAL,DIMENSION,EXTERNAL,FORMAT,END,LOGICAL,COMPLEX,DATA
A,CALL,ASSIGN,CHARACTER);RETURN;END;SUBROUTINESUBROUTINE(IMPLICIT,L
LOGICAL,GOTO,IF,INTEGER);INTEGERGOTO,IMPLICIT(GOTO),LOGICAL(GOTO),I
IF,INTEGER,EXTERNAL,RETURN;DOFOREXTERNAL=IF,GOTO;DOFORRETURN=INTEGE
ER,EXTERNAL-IF;IMPLICIT(RETURN)=LOGICAL(RETURN)+LOGICAL(RETURN-IF);
;ENDDO;IMPLICIT(IF)=IF;IMPLICIT(EXTERNAL)=IF;DOFORRETURN=IF,GOTO-EX
XTERNAL;WRITE(IF,'(''$ '')');ENDDO;DOFORRETURN=IF,EXTERNAL;WRITE(I
IF,'(''$''I4)')IMPLICIT(RETURN);ENDDO;WRITE(IF,'( /)');DOFORRETURN=
=IF,GOTO;LOGICAL(RETURN)=IMPLICIT(RETURN);ENDDO;ENDDO;END
The output should be something like this:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
1 10 45 120 210 252 210 120 45 10 1
1 11 55 165 330 462 462 330 165 55 11 1
1 12 66 220 495 792 924 792 495 220 66 12 1
I admit, I'm glad I'm not a compiler writer. But they do have an amazing product that is very useful to a lot of people and still quite popular. BTW: Here is the same program, in a bit more readable form:
PROGRAM BLOCK
INTEGER I1,I2,I3,I4,I5
DIMENSION I1(13),I2(13)
I4=1
I5=2
I3=13
CALL PASCAL(I1,I2,I3,I4,I5)
END
SUBROUTINE PASCAL(IP1,IP2,IP3,IP4,IP5)
INTEGER IP3,IP1(IP3),IP2(IP3),IP4,IP5
INTEGER IP6,IP7
DO IP6=IP4,IP3
DO IP7=IP5,IP6-IP4
IP1(IP7)=IP2(IP7)+IP2(IP7-IP4)
ENDDO
IP1(IP4)=IP4
IP1(IP6)=IP4
DO IP7=IP4,IP3-IP6
WRITE(*,'(" "$)')
ENDDO
DO IP7=IP4,IP6
WRITE(*,'(I4$)') IP1(IP7)
ENDDO
WRITE(*,*)
DO IP7=IP4,IP3
IP2(IP7)=IP1(IP7)
ENDDO
ENDDO
END