Abelian sandpile model/Identity: Difference between revisions

m
m (→‎Python :: Functional: Refactored in terms of a general convergence function.)
Line 1,272:
def conv(prev, ys):
y = next(ys)
ifreturn p([prev,] y):+ (
return [prev] if p(prev, y) else conv(y, ys)
else:)
return [prev] + conv(y, ys)
return conv(next(xs), xs)
return go
9,655

edits