Sha256: 29b7a1e0b7e6a062839375321da525d3936fcd78f8fe0fb217d676c09825695a

Contents?: true

Size: 761 Bytes

Versions: 205

Compression:

Stored size: 761 Bytes

Contents

module pangram
contains
  logical function is_pangram(sentance)
    implicit none
    character(*) :: sentance
    logical :: seen(26)
    integer :: i,val

    seen = .false.

    do i = 1,len(sentance)
      val = to_index(sentance(i:i))
      if ( val .ne. 0 ) then
        seen(val:val) = .true.
      end if
    end do

    is_pangram = all(seen)
   end function is_pangram

   integer function to_index(chr)
       implicit none
       character :: chr

       if ((chr .ge. 'a' ) .and. (chr .le. 'z')) then
         to_index = ichar('z') - ichar(chr) + 1
       else if ((chr .ge. 'A' ) .and. (chr .le. 'Z')) then
         to_index = ichar('Z') - ichar(chr) + 1
       else
         to_index = 0
       end if
   end function to_index
end module pangram

Version data entries

205 entries across 205 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.179 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.178 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.177 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.176 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.175 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.174 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.173 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.172 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.171 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.170 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.169 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.167 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.166 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.165 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.164 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.163 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.162 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.161 tracks/fortran/exercises/pangram/example.f90
trackler-2.2.1.160 tracks/fortran/exercises/pangram/example.f90