      	COMMON /CSEED/ ISEED
	iseed=41

	npond=0
	do ntotal=1,100000
	  x=2.0*(ranf()-0.5)
	  y=2.0*(ranf()-0.5)
	  r2=x*x+y*y
	  if(r2.le.1.0)npond=npond+1
	  if(mod(ntotal,10000).eq.0) then
 	    print*,ntotal,4.0*float(npond)/float(ntotal)
	  endif
	end do

	stop
	end
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
      FUNCTION RANF()
      DATA IA/16807/,IC/2147483647/,IQ/127773/,IR/2836/
      COMMON /CSEED/ ISEED
        IH = ISEED/IQ
        IL = MOD(ISEED,IQ)
        IT = IA*IL-IR*IH
        IF(IT.GT.0) THEN
          ISEED = IT
        ELSE
          ISEED = IC+IT
        END IF
        RANF = ISEED/FLOAT(IC)
      RETURN
      END
