Soldier crabs Mictyris guinotae exhibit pronounced swarming behaviour. The swarms of the crabs tolerant of perturbations. In computer models and laboratory experiments we demonstrate that swarms of soldier crabs can implement logical gates when placed in a geometrically constrained environment.