Materials that respond to external stimuli by expanding or contracting provide a transduction route that integrates sensing and actuation powered directly by the stimuli. This motivates us to build colloidal scale robots using these materials that can morph into arbitrary configurations. For intelligent use of global stimuli in robotic systems, computation ability needs to be incorporated within them. The challenge is to design an architecture that is compact, material agnostic, stable under stochastic forces and can employ stimuli-responsive materials. We present an architecture that computes combinatorial logic using mechanical gates that use muscle-like response - expansion and contraction - as circuit signal with additional benefits of logic circuitry being physically flexible and able to be retrofit to arbitrary robot bodies. We mathematically analyze gate geometry and discuss tuning it for the given requirements of signal dimension and magnitude. We validate the function and stability of the design at the colloidal scale using Brownian dynamics simulations. We also demonstrate the gate design using a 3D printed model. Finally, we simulate a complete robot that folds into Tetris shapes.