Click the pi to flip a coin. When you flip 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. If your estimate beats the best estimate so far it will be set to the closest to pi variable.
Based on the Matt Parker 2026 Standup Maths Pi Day Video.