implicit none real x,y,acaso,ngol ; integer i,ntiri ; character title*40 call graphiclayout ntiri=100 ; ngol=0 do i=1,ntiri x=acaso(x) ; y=acaso(y) call disegnapunto(x,y) if (x**2+y**2.lt.1) ngol=ngol+1 enddo write(title,'(a,f4.2)') 'Estimated value of pi-grec: ',4*ngol/ntiri call displayplot(' ',' ',title) end subroutine disegnapunto(x,y) implicit none real x,y call pallocchetto ((x+1)/2,(y+1)/2,0.005,9) return end subroutine graphiclayout call mvsetflags('Palette di colori',8.0) call mvsetflags('Colore Titoli',6.0) call mvsetflags('Random seed',3388148907.0) call scrivisulplot(' ',0.85,0.05) call set (0.0,1.0,0.0,1.0,-1.0,1.0,-1.0,1.0,1) call pallocchetto (0.5,0.5,0.5,8) call linea(0.0,-1.0,0.0,1.0) call linea(-1.0,0.0,1.0,0.0) return end