PROGRAM throw
    IMPLICIT NONE
    INTEGER :: k, n

    DO k = 1,10
        n = twodice()
        PRINT *, n
    END DO

CONTAINS

    FUNCTION twodice ()
        IMPLICIT NONE
        INTEGER :: twodice
        REAL :: temp
        CALL RANDOM_NUMBER(temp)
        twodice = INT(6.0*temp+1.0)
        CALL RANDOM_NUMBER(temp)
        twodice = twodice+INT(6.0*temp+1.0)
    END FUNCTION twodice

END PROGRAM throw
