This will automatically flip a coin over and over again. When it flips more heads than tails, it will add the ratio of heads to flips to the total average. As you repeat this, the average of these ratios should converge to pi/4.
Based on the Matt Parker 2026 Standup Maths Pi Day Video.