The following code is a Gravity ‘cat’ program (a ‘cat’ program copies its input to the output). The encoding used can be any encoding that maps characters to a series of 3s and 4s (for example, mapping characters to their Unicode positions, and then turning 0 and 1 bits into 3s and 4s respectively).
(0,0) : 2
(1,1,1,1,2) -> # :
(1,1,1,1,3) -> # : 3
(1,1,1,1,4) -> # : 4
Proof of function
By having a heavier particle at the origin, all particles start moving inwards. When the particles at (1,0), (0,1), (−1,0) and (0,−1) collide with this particle, a mass is read from the input.
Every collision after this consists of four or more particles hitting the origin. In an unbounded number of collisions, exactly four particles will hit the particle at the origin, which will output the mass of the particle at the origin and replace it with a mass from the input (or halt if there is no further input). In the other collisions, the particle at the origin has the greatest mass and is therefore replaced after the collision.