      PROGRAM simple_map
*     corrected on 1/30/97
      IMPLICIT NONE
      REAL*8 x, xnew, y
      INTEGER IR_, i
      CALL GWopen(IR_, 0)
      CALL initial(x,y)
      DO i = 1, 100000
         xnew = 1 - y + abs(x)
         y = x
         x = xnew
         CALL GWsetpxl(IR_, REAL(x), REAL(y), 16)
      END DO
      CALL GWquit(IR_)
      END
C
      SUBROUTINE initial(x0,y0)
      IMPLICIT NONE
      REAL*8 x0, y0
      REAL mx, my, xmax, xmin, ymax, ymin
      INTEGER IR_
      WRITE(*,'(A,$)') 'initial value of x = '
      READ(*,*) x0
      WRITE(*,'(A,$)') 'initial value of y = '
      READ(*,*) y0
      xmin = -3
      xmax = 8
      ymin = -3
      ymax = 8
      mx = 0.01*(xmax - xmin)               ! margin
      my = 0.01*(ymax - ymin)
      CALL GWindow(IR_, xmin - mx, ymin - my, xmax + mx, ymax + my)
      CALL GWrect(IR_, xmin, ymin, xmax, ymax)  ! draw border
      END
