home *** CD-ROM | disk | FTP | other *** search
- 10 ifx=0thenx=1:load"sysplotterd.o",8,1
- 20 sys49158:gosub400
- 60 :
- 70 sys49173,0,0,0,150
- 72 sys49173,0,150,180,150
- 74 sys49173,180,150,180,0
- 76 sys49173,180,0,0,0
- 78 :
- 80 radius=180*180
- 82 ix=0:iy=150
- 84 forx=0to180step3
- 86 y=sqr(radius-x^2)*5/6
- 88 sys49173,ix,iy,x,y:ix=x:iy=y
- 90 next
- 92 sys49179,"press a key to see current value",0,180
- 93 sys49179,"(press 'q' to quit)",0,190
- 95 :
- 100 fori=1to1000000
- 102 x=rnd(2):y=rnd(2):ifx*x+y*y<1thens=s+1
- 104 ifx<.5thenlx=lx+1
- 106 ify<.5thenly=ly+1
- 108 x=x*180:y=y*150:sys49167,x,y
- 110 ifi>1thenpi=4*s/(i-1)
- 112 ifpeek(198)>0thengosub300
- 114 next
- 120 pi=4*2/(i+1)
- 130 gosub1000
- 140 print"[147]1,000,000 plots ==>"pi
- 145 print"press a key to return to loadstar."
- 150 poke198,0:wait198,1:geta$
- 160 load"hello connect",8:end
- 300 rem see answer
- 305 geta$:ifa$="q"thensys49155:print"[147]":load"hello connect",8:end
- 310 sys49155:print"[147]"chr$(142)
- 320 print"pi is approximated by"pi:print"in"i"iterations."
- 330 print"press a key to continue..."
- 340 poke198,0:wait198,1:geta$
- 350 gosub400:return
- 400 sys49161,1:sys49164,0:sys49152:return
-