Skip to content

Galton Board

Run the Galton Board MicroSim Edit the MicroSim

Prompt

Create a p5.js sketch that simulates a Galton Board.
It is also called a Plinko game.
The sketch has "New Ball" button that triggers a blue
circle with radius=5 falling from the top middle of the
canvas.  Below it is a set of pins in a triangular pattern.
The ball will bounce on the top pin.
There is a 50% chance the ball bounces left and 50% on the right.
There is a second row of two pins, each with the same odds.
On the third row, there are three pins.
On the fourth row there are four pins.
Continue this pattern for 6 rows.

Simon Tiger's Galton Board

Other sketches by Simon Tiger https://editor.p5js.org/simontiger/sketches

Plinko by Coding Train