C     .TITLE RAND1
C
C   5 MAR 76 - PAUL HENDERSON
C
C  PROGRAM TO VALIDATE RANDOM NUMBER GENERATOR
C
      INTEGER IVECT(200)
      REAL POINTS(2,32)
      COMMON /LIMITS/XMIN,XMAX,YMIN,YMAX
C
   1  XMIN = 0.
      XMAX = 1023.
      YMIN = -1.
      YMAX =  1.
      CALL CLEAR (.TRUE.)
      CALL DSPLAY (0,40000,IERR,IGET)
C
   2  X = 0.
      DO 4 J=1,32
      DO 3 K=1,32
      POINTS(1,K) = X
      CALL RANDOM (POINTS(2,K))
      X = X + 1.
   3  CONTINUE
      CALL VECTOR (3,POINTS,1,32,IVECT,1,LAST,7,0,.FALSE.)
      CALL DSPLAY (6,J,IERR,IVECT,1,LAST)
      CALL DSPLAY (3,J-1,IERR)
      CALL PULSE (0,IC)
   4  CONTINUE
C
      PAUSE 1
      PAUSE 2
      CALL DSPLAY (8,IGET,IERR)
      CALL PULSE (0,IC)
      GO TO 2
      END
      SUBROUTINE RANDOM (R)
      INTEGER*2 KLA(2),KL
      INTEGER*4 KERNEL/65539/
      EQUIVALENCE (KERNEL,KLA(1)),(KLA(2),KL)
C
      KERNEL = KERNEL * 347
      R = KL/131072.
   2  IF (KERNEL .LE. 67108864) RETURN
      KERNEL = KERNEL - 67108864
      GO TO 2
      END
