program Buffon1 { Buffon's Needle; www.merlyn.demon.co.uk >= 2001-08-29; TP7 BP7 D3 TMT} ; { NOTE : This is only a demonstration; Pi is used explicitly, and implicitly in cos } var U, V, W : longint ; BEGIN ; W := 1000000 ; Write('Buffon1 ', W, ' ... ') ; V := 0 ; Randomize ; for U := 1 to W do if cos(Random*Pi*0.5)>Random then Inc(V) ; Write('"Pi" : ', 2.0/(V/W):0:6, ' ') ; Readln ; END.