Each unit is a square module on an integer 2D lattice (x = position along the row, y = height above the floor). A module never slides — it relocates by pivoting 90° around a corner shared with a stationary neighbor, the same "roll around your neighbor" locomotion MIT's M-Blocks use in 3D, viewed here edge-on.
Floor roll (y = 0, moving sideways):
the floor itself is the anchor
valid if the destination cell is empty
Climb (y changes by +-1, x changes by +-1):
an anchor cell, face-adjacent to BOTH the start and
destination cell, must already be occupied
the module pivots around that shared corner
A climb from cell A to a diagonal cell B needs a stationary anchor module adjacent to both — without it there is nothing to pivot around, so the move is rejected. On the ground row (y = 0) the floor plays that role, so lateral rolls are always free.
- Target shape — the controller computes which modules must vacate their cell and greedily assigns each to the nearest empty cell in the new shape (Manhattan distance).
- Every module then breadth-first searches the lattice, one pivot step at a time, using only currently-legal floor rolls and anchored climbs — occupied cells block the search just like a real neighbor would.
- A module with no legal next step is marked stalled and retried on the next pass, once other modules have moved out of its way — this is exactly how a real distributed reconfiguration protocol makes progress without central coordination.
Fixed from the 3D source: the original 3D engine (robotics/robotics-topic-100/) always anchors a climb at the destination cell's horizontal position. That is correct for climbing up, but for climbing down it makes the anchor cell identical to the destination cell itself — which must be empty to be a valid target, so the anchor check can never pass and descents silently never happen. This 2D engine anchors a climb at whichever of the two cells sits at the higher row, which is adjacent to both start and destination in both directions and lets modules legally climb down as well as up.
Real-world relevance: self-reconfiguring modular robots are studied for spacecraft structures, disaster-terrain adaptation and reconfigurable furniture/bridges — a swarm of identical units that becomes whatever shape the task needs.