This browser has no WebGPU, so the sketch cannot run here. The program is below, and it runs in a current Chrome, Edge or Safari.
Sandpile
Abelian sandpile model
///////////////////////////////////////
// abelian-sandpile
// https://en.wikipedia.org/wiki/Abelian_sandpile_model
//////////////////////////////////////
&sz = (64,64,1);
// neighbors
&V = #(0, 0);
&N = #(0, -1);
&S = #(0, 1);
&E = #(1, 0);
&W = #(-1, 0);
¢erDot = (sml( dst(C, 0), div(2, #.dim) ));
#A{
dim = &sz;
set = (0);
run =
add(
¢erDot,
add(
mlt(&V,sml(&V, 0.99)),
mlt(
0.25,
add(
lrg(&W, 0.99),
lrg(&N, 0.99),
lrg(&E, 0.99),
lrg(&S, 0.99)
)
)
)
);
}
~A { col = #A;}