Skip to content

Instantly share code, notes, and snippets.

@GlenDC
Last active December 6, 2015 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GlenDC/fe29dc3e8dc77d7c6078 to your computer and use it in GitHub Desktop.
Save GlenDC/fe29dc3e8dc77d7c6078 to your computer and use it in GitHub Desktop.
My first attempt for the Quine Challenge
PROGRAM QUINE
IMPLICIT NONE
INTEGER :: i
CHARACTER(LEN=80), DIMENSION(10) :: Source
Source(1) = "PROGRAM QUINE"
Source(2) = " IMPLICIT NONE"
Source(3) = " INTEGER :: i"
Source(4) = " DO i=1, 3"
Source(5) = " DO i=1, 5"
Source(6) = " END DO"
DO i=1, 3
WRITE(*,*) Source(i)
END DO
DO i=1, 6
WRITE(*,*) " Source(" // CHAR(48+i) // ") = """ // TRIM(Source(i)) // """"
END DO
END PROGRAM QUINE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment