  Materials with an irreversible response to cyclic driving exhibit an evolving
internal state which, in principle, encodes information on the driving history.
Here we realize irreversible metamaterials that count mechanical driving cycles
and store the result into easily interpretable internal states. We extend these
designs to aperiodic metamaterials which are sensitive to the order of
different driving magnitudes, and realize 'lock and key' metamaterials that
only reach a specific state for a given target driving sequence. Our strategy
is robust, scalable and extendable, and opens new routes towards smart sensing,
soft robotics and mechanical information processing.
