summaryrefslogtreecommitdiff
path: root/map65/libm65/graycode.f90
blob: ea818c0fb98d05cec3581b4090d12f82605f5159 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module graycode_mod
  implicit none
  interface
    integer function igray(n, idir)
      integer, intent(in) :: n, idir
    end function igray
  end interface
contains
  subroutine graycode(dat, n, idir)
    integer, intent(in)    :: n, idir
    integer, intent(inout) :: dat(n)
    integer :: i

    do i = 1, n
       dat(i) = igray(dat(i), idir)
    enddo
  end subroutine graycode
end module graycode_mod