Embodied intelligence solves the centipede’s dilemma