Box-ball system (source code)

= Box-ball system

The <box-ball system> is a discrete <cellular automaton> with a row of boxes, each either empty or holding one ball. Consider finitely many balls and unlimited empty boxes to the right. During one update, process the original balls from left to right and move each exactly once to the nearest currently empty box on its right. The ordering and the instruction to move each ball only once are part of the evolution rule.

An isolated block of three balls in boxes $\{0,1,2\}$ moves to $\{3,4,5\}$ in one update. More generally, an isolated block of $k$ balls moves $k$ boxes per step, preserving its shape. Interacting patterns have a <soliton> interpretation: localized structures re-emerge with conserved identities, and the system has further conserved quantities.<A Soliton Cellular Automaton by Daisuke Takahashi and Junkichi Satsuma>[Publisher abstract: solitary-wave interactions preserve identities; infinitely many conserved quantities]{ref} This gives a particularly concrete setting in which a simple integer update rule produces organized wave-like motion.