ScratchData LogoScratchData
Back to peekir's profile

Buffon's Needle

PEpeekir•Created July 31, 2020
Buffon's Needle
1
0
12 views
View on Scratch

Instructions

I just learned about Buffon's needle problem and wanted to see for myself if I could get close to generating π. Hit the green flag, which will randomly drop needles. If a needle touches the pink line it will turn purple and add to the "crosses" variable. In the project π=2*(Drops / Crosses).

Description

https://en.wikipedia.org/wiki/Buffon%27s_needle_problem This seems to skew high (giving me between 3.25 and 3.4 or so). I am guessing this has to do with the thickness of the sprite, or how sprites interact with side of the stage, perhaps. But is pretty close. Note: The stage resets every 300 drops, due to the maximum number of clones you can have but the variables keep counting up.

Project Details

Project ID415041035
CreatedJuly 31, 2020
Last ModifiedJuly 31, 2020
SharedJuly 31, 2020
Visibilityvisible
CommentsAllowed